Bug 1420349 - Instantiate the sync scheduler in the service's constructor, instead of in onStartup. r?eoger draft
authorThom Chiovoloni <tchiovoloni@mozilla.com>
Tue, 28 Nov 2017 11:48:10 -0500
changeset 704666 9a0382b64c2c47e3cf7e9aa0b8d0cc9e77da7202
parent 700576 5c48b5edfc4ca945a2eaa5896454f3f4efa9052a
child 742111 d1e0473c814e21fc8c3864c169e6a070ef997dc3
push id91193
push userbmo:tchiovoloni@mozilla.com
push dateTue, 28 Nov 2017 19:02:12 +0000
reviewerseoger
bugs1420349
milestone59.0a1
Bug 1420349 - Instantiate the sync scheduler in the service's constructor, instead of in onStartup. r?eoger MozReview-Commit-ID: 3bOnRH5jR9e
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -64,16 +64,17 @@ function getEngineModules() {
 
 // A unique identifier for this browser session. Used for logging so
 // we can easily see whether 2 logs are in the same browser session or
 // after the browser restarted.
 XPCOMUtils.defineLazyGetter(this, "browserSessionID", Utils.makeGUID);
 
 function Sync11Service() {
   this._notify = Utils.notify("weave:service:");
+  this.scheduler = new SyncScheduler(this);
 }
 Sync11Service.prototype = {
 
   _lock: Utils.lock,
   _locked: false,
   _loggedIn: false,
 
   infoURL: null,
@@ -317,18 +318,16 @@ Sync11Service.prototype = {
                       "Weave, since it will not work correctly.");
     }
 
     Svc.Obs.add("weave:service:setup-complete", this);
     Svc.Obs.add("sync:collection_changed", this); // Pulled from FxAccountsCommon
     Svc.Obs.add("fxaccounts:device_disconnected", this);
     Services.prefs.addObserver(PREFS_BRANCH + "engine.", this);
 
-    this.scheduler = new SyncScheduler(this);
-
     if (!this.enabled) {
       this._log.info("Firefox Sync disabled.");
     }
 
     this._updateCachedURLs();
 
     let status = this._checkSetup();
     if (status != STATUS_DISABLED && status != CLIENT_NOT_CONFIGURED) {