mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 972129 - introduce a custom backoff schedule if failure is due to identity manager not being ready. r=rnewman
This commit is contained in:
parent
d8548f5d88
commit
225c7f7993
@ -54,6 +54,11 @@ HMAC_EVENT_INTERVAL: 600000,
|
||||
// How long to wait between sync attempts if the Master Password is locked.
|
||||
MASTER_PASSWORD_LOCKED_RETRY_INTERVAL: 15 * 60 * 1000, // 15 minutes
|
||||
|
||||
// How long to initially wait between sync attempts if the identity manager is
|
||||
// not ready. As we expect this to become ready relatively quickly, we retry
|
||||
// in (IDENTITY_NOT_READY_RETRY_INTERVAL * num_failures) seconds.
|
||||
IDENTITY_NOT_READY_RETRY_INTERVAL: 5 * 1000, // 5 seconds
|
||||
|
||||
// Separate from the ID fetch batch size to allow tuning for mobile.
|
||||
MOBILE_BATCH_SIZE: 50,
|
||||
|
||||
|
@ -30,6 +30,8 @@ SyncScheduler.prototype = {
|
||||
LOGIN_FAILED_INVALID_PASSPHRASE,
|
||||
LOGIN_FAILED_LOGIN_REJECTED],
|
||||
|
||||
_loginNotReadyCounter: 0,
|
||||
|
||||
/**
|
||||
* The nsITimer object that schedules the next sync. See scheduleNextSync().
|
||||
*/
|
||||
@ -113,6 +115,10 @@ SyncScheduler.prototype = {
|
||||
// we'll handle that later
|
||||
Status.resetBackoff();
|
||||
|
||||
// Reset the loginNotReady counter, just in-case the user signs in
|
||||
// as another user and re-hits the not-ready state.
|
||||
this._loginNotReadyCounter = 0;
|
||||
|
||||
this.globalScore = 0;
|
||||
break;
|
||||
case "weave:service:sync:finish":
|
||||
@ -155,6 +161,13 @@ SyncScheduler.prototype = {
|
||||
this._log.debug("Couldn't log in: master password is locked.");
|
||||
this._log.trace("Scheduling a sync at MASTER_PASSWORD_LOCKED_RETRY_INTERVAL");
|
||||
this.scheduleAtInterval(MASTER_PASSWORD_LOCKED_RETRY_INTERVAL);
|
||||
} else if (Status.login == LOGIN_FAILED_NOT_READY) {
|
||||
this._loginNotReadyCounter++;
|
||||
this._log.debug("Couldn't log in: identity not ready.");
|
||||
this._log.trace("Scheduling a sync at IDENTITY_NOT_READY_RETRY_INTERVAL * " +
|
||||
this._loginNotReadyCounter);
|
||||
this.scheduleAtInterval(IDENTITY_NOT_READY_RETRY_INTERVAL *
|
||||
this._loginNotReadyCounter);
|
||||
} else if (this._fatalLoginStatus.indexOf(Status.login) == -1) {
|
||||
// Not a fatal login error, just an intermittent network or server
|
||||
// issue. Keep on syncin'.
|
||||
|
Loading…
Reference in New Issue
Block a user