diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-08-15 09:58:13 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-08-15 10:36:58 +0200 |
commit | 2925fdc3ee9acf17c4aa5494afb7cc18c8dc10bd (patch) | |
tree | 75ed3e1b9d8c385535e307a6116b594442a46ac2 /services/sync/modules/service.js | |
parent | 8c34d786e46adbcf5496549cb3fe1898761632d4 (diff) | |
download | UXP-2925fdc3ee9acf17c4aa5494afb7cc18c8dc10bd.tar UXP-2925fdc3ee9acf17c4aa5494afb7cc18c8dc10bd.tar.gz UXP-2925fdc3ee9acf17c4aa5494afb7cc18c8dc10bd.tar.lz UXP-2925fdc3ee9acf17c4aa5494afb7cc18c8dc10bd.tar.xz UXP-2925fdc3ee9acf17c4aa5494afb7cc18c8dc10bd.zip |
Issue #1208: Remove `services.sync.enabled` pref.
Sync will not do anything unless specifically set up to do so and at
least one engine is enabled, so there's no need for this "master switch"
to force it disabled based on engines being disabled (which was its
previous function to shortcut syncing in that situation).
Diffstat (limited to 'services/sync/modules/service.js')
-rw-r--r-- | services/sync/modules/service.js | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index 15884aca0..804eb20cd 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -296,21 +296,6 @@ Sync11Service.prototype = { return false; }, - // The global "enabled" state comes from prefs, and will be set to false - // whenever the UI that exposes what to sync finds all Sync engines disabled. - get enabled() { - return Svc.Prefs.get("enabled"); - }, - set enabled(val) { - // There's no real reason to impose this other than to catch someone doing - // something we don't expect with bad consequences - all setting of this - // pref are in the UI code and external to this module. - if (val) { - throw new Error("Only disabling via this setter is supported"); - } - Svc.Prefs.set("enabled", val); - }, - /** * Prepare to initialize the rest of Weave after waiting a little bit */ @@ -340,6 +325,8 @@ Sync11Service.prototype = { this._clusterManager = this.identity.createClusterManager(this); this.recordManager = new RecordManager(this); + this.enabled = true; + this._registerEngines(); let ua = Cc["@mozilla.org/network/protocol;1?name=http"]. @@ -1236,10 +1223,6 @@ Sync11Service.prototype = { }, sync: function sync() { - if (!this.enabled) { - this._log.debug("Not syncing as Sync is disabled."); - return; - } let dateStr = new Date().toLocaleFormat(LOG_DATE_FORMAT); this._log.debug("User-Agent: " + SyncStorageRequest.prototype.userAgent); this._log.info("Starting sync at " + dateStr); |