commit fffa1badd451243496413f94231373a2af0f3a17
parent 9920a845c635649eb09ed4348cfe2dc2e4389230
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 6 Aug 2017 17:50:26 +0200
Stop storage requests on shutdown
Diffstat:
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
@@ -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
@@ -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
@@ -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,