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:
Edward Lee 2009-11-30 14:03:59 -08:00
parent 6baeee3ae5
commit 4e72f0165b

View File

@ -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);
},
/**