From fffa1badd451243496413f94231373a2af0f3a17 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 6 Aug 2017 17:50:26 +0200 Subject: [PATCH] Stop storage requests on shutdown --- chrome/content/zotero/xpcom/storage/storageEngine.js | 2 +- chrome/content/zotero/xpcom/sync/syncEngine.js | 2 +- chrome/content/zotero/xpcom/sync/syncRunner.js | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage/storageEngine.js b/chrome/content/zotero/xpcom/storage/storageEngine.js index a5df9c8fa3..8c7b991971 100644 --- a/chrome/content/zotero/xpcom/storage/storageEngine.js +++ b/chrome/content/zotero/xpcom/storage/storageEngine.js @@ -282,7 +282,7 @@ Zotero.Sync.Storage.Engine.prototype.start = Zotero.Promise.coroutine(function* Zotero.Sync.Storage.Engine.prototype.stop = function () { - Zotero.debug("Stopping file syncing for " + this.library.name); + Zotero.debug("Stopping file sync for " + this.library.name); for (let type in this.queues) { this.queues[type].stop(); } diff --git a/chrome/content/zotero/xpcom/sync/syncEngine.js b/chrome/content/zotero/xpcom/sync/syncEngine.js index bee54a3712..d74491eff4 100644 --- a/chrome/content/zotero/xpcom/sync/syncEngine.js +++ b/chrome/content/zotero/xpcom/sync/syncEngine.js @@ -210,7 +210,7 @@ Zotero.Sync.Data.Engine.prototype.start = Zotero.Promise.coroutine(function* () * Stop the sync process */ Zotero.Sync.Data.Engine.prototype.stop = function () { - Zotero.debug("Stopping sync for " + this.library.name); + Zotero.debug("Stopping data sync for " + this.library.name); this._stopping = true; } diff --git a/chrome/content/zotero/xpcom/sync/syncRunner.js b/chrome/content/zotero/xpcom/sync/syncRunner.js index f1f6184d97..ed5d6e55f5 100644 --- a/chrome/content/zotero/xpcom/sync/syncRunner.js +++ b/chrome/content/zotero/xpcom/sync/syncRunner.js @@ -79,6 +79,8 @@ Zotero.Sync.Runner_Module = function (options = {}) { var _currentLastSyncLabel; var _errors = []; + Zotero.addShutdownListener(() => this.stop()); + this.getAPIClient = function (options = {}) { return new Zotero.Sync.APIClient({ baseURL: this.baseURL,