Merge pull request #1757 from kafji/kfj/fix-sync-hog
Fix sync resource hog
This commit is contained in:
commit
e830a5bcd8
2 changed files with 4 additions and 4 deletions
|
@ -89,13 +89,13 @@ window.assignManager = {
|
|||
return;
|
||||
},
|
||||
|
||||
async remove(pageUrlorUrlKey) {
|
||||
async remove(pageUrlorUrlKey, shouldSync = true) {
|
||||
const siteStoreKey = this.getSiteStoreKey(pageUrlorUrlKey);
|
||||
// When we remove an assignment we should clear all the exemptions
|
||||
this.removeExempted(pageUrlorUrlKey);
|
||||
await this.area.remove([siteStoreKey]);
|
||||
const syncEnabled = await this.getSyncEnabled();
|
||||
if (syncEnabled) await sync.storageArea.backup({siteStoreKey});
|
||||
if (shouldSync && syncEnabled) await sync.storageArea.backup({siteStoreKey});
|
||||
return;
|
||||
},
|
||||
|
||||
|
|
|
@ -493,9 +493,9 @@ async function reconcileSiteAssignments() {
|
|||
await sync.storageArea.getDeletedSiteList();
|
||||
for(const siteStoreKey of deletedSiteList) {
|
||||
if (Object.prototype.hasOwnProperty.call(assignedSitesLocal,siteStoreKey)) {
|
||||
assignManager
|
||||
await assignManager
|
||||
.storageArea
|
||||
.remove(siteStoreKey);
|
||||
.remove(siteStoreKey, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue