Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/prefs.js

Issue 29875591: Noissue - Simplify write throttling for blocked_total pref on Firefox (Closed)
Patch Set: Created Sept. 5, 2018, 3:27 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/prefs.js
===================================================================
--- a/lib/prefs.js
+++ b/lib/prefs.js
@@ -300,8 +300,6 @@
// Saving one storage value causes all others to be saved as well on Gecko.
// Make sure that updating ad counter doesn't cause the filters data to be
// saved frequently as a side-effect.
- const MIN_UPDATE_INTERVAL = 60 * 1000;
- let lastUpdate = -MIN_UPDATE_INTERVAL;
let promise = null;
customSave.set("blocked_total", pref =>
{
@@ -312,11 +310,10 @@
setTimeout(
() =>
{
- lastUpdate = performance.now();
promise = null;
savePref(pref).then(resolve, reject);
},
- lastUpdate + MIN_UPDATE_INTERVAL - performance.now()
+ 60 * 1000
);
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld