Stop storage requests on shutdown

This commit is contained in:
Dan Stillman 2017-08-06 17:50:26 +02:00
parent 9920a845c6
commit fffa1badd4
3 changed files with 4 additions and 2 deletions

View file

@ -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();
}

View file

@ -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;
}

View file

@ -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,