mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 504256 - sync should observe idle service and only sync when the user is idle
Detect if the user has been recently active, and if so, skip the sync. Arbitrarily picking 30 seconds for now.
This commit is contained in:
parent
2f261f5115
commit
c5690e2288
@ -794,6 +794,13 @@ WeaveSvc.prototype = {
|
||||
*/
|
||||
sync: function WeaveSvc_sync(fullSync)
|
||||
this._catch(this._lock(this._notify("sync", "", function() {
|
||||
|
||||
// Skip this incremental sync if the user has been active recently
|
||||
if (!fullSync && Svc.Idle.idleTime < 30000) {
|
||||
this._log.debug("Skipped sync because the user was active.");
|
||||
return;
|
||||
}
|
||||
|
||||
fullSync = true; // not doing thresholds yet
|
||||
|
||||
// Use thresholds to determine what to sync only if it's not a full sync
|
||||
|
@ -719,6 +719,7 @@ Svc.Prefs = new Preferences(PREFS_BRANCH);
|
||||
["Bookmark", "@mozilla.org/browser/nav-bookmarks-service;1", "nsINavBookmarksService"],
|
||||
["Crypto", "@labs.mozilla.com/Weave/Crypto;1", "IWeaveCrypto"],
|
||||
["Directory", "@mozilla.org/file/directory_service;1", "nsIProperties"],
|
||||
["Idle", "@mozilla.org/widget/idleservice;1", "nsIIdleService"],
|
||||
["IO", "@mozilla.org/network/io-service;1", "nsIIOService"],
|
||||
["Login", "@mozilla.org/login-manager;1", "nsILoginManager"],
|
||||
["Memory", "@mozilla.org/xpcom/memory-service;1", "nsIMemory"],
|
||||
|
Loading…
Reference in New Issue
Block a user