Merge pull request #1757 from kafji/kfj/fix-sync-hog

Fix sync resource hog
This commit is contained in:
Andrea Marchesini
2021-10-25 16:59:59 +02:00
committed by GitHub
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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;
},