Bug 1317587 - don't start scheduled sync after shutdown. r?rnewman
MozReview-Commit-ID: GSyWAUa1qyr
--- a/services/sync/modules/policies.js
+++ b/services/sync/modules/policies.js
@@ -396,16 +396,25 @@ SyncScheduler.prototype = {
this._log.debug("Not initiating sync: Login status is " + Status.login);
// If we're not syncing now, we need to schedule the next one.
this._log.trace("Scheduling a sync at MASTER_PASSWORD_LOCKED_RETRY_INTERVAL");
this.scheduleAtInterval(MASTER_PASSWORD_LOCKED_RETRY_INTERVAL);
return;
}
+ try {
+ Async.checkAppReady()
+ } catch (ex) {
+ if (Async.isShutdownException(ex)) {
+ this._log.debug("Not initiating sync: app is shutting down");
+ return;
+ }
+ throw ex;
+ }
Utils.nextTick(this.service.sync, this.service);
},
/**
* Set a timer for the next sync
*/
scheduleNextSync: function scheduleNextSync(interval) {
// If no interval was specified, use the current sync interval.