mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Bug 531943 - Sync scheduled by global threshold during private browsing
Use checkSyncStatus instead of directly calling syncOnIdle or scheduleNextSync so that we only schedule if we're okay to sync.
This commit is contained in:
parent
6baeee3ae5
commit
4e72f0165b
@ -428,17 +428,9 @@ WeaveSvc.prototype = {
|
||||
}
|
||||
|
||||
this._log.trace("Global score updated: " + this.globalScore);
|
||||
|
||||
if (this.globalScore > this.syncThreshold) {
|
||||
this._log.debug("Global Score threshold hit, triggering sync.");
|
||||
this.syncOnIdle();
|
||||
}
|
||||
else if (!this._syncTimer) // start the clock if it isn't already
|
||||
this._scheduleNextSync();
|
||||
this._checkSyncStatus();
|
||||
},
|
||||
|
||||
// These are global (for all engines)
|
||||
|
||||
// gets cluster from central LDAP server and returns it, or null on error
|
||||
_findCluster: function _findCluster() {
|
||||
this._log.debug("Finding cluster for user " + this.username);
|
||||
@ -985,8 +977,13 @@ WeaveSvc.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
// otherwise, schedule the sync
|
||||
this._scheduleNextSync();
|
||||
// Only set the wait time to 0 if we need to sync right away
|
||||
let wait;
|
||||
if (this.globalScore > this.syncThreshold) {
|
||||
this._log.debug("Global Score threshold hit, triggering sync.");
|
||||
wait = 0;
|
||||
}
|
||||
this._scheduleNextSync(wait);
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user