From ad90f90006e485804ee9fed9c62c097cd3e5c54e Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 7 Jul 2008 15:56:24 +0000 Subject: [PATCH] Don't throw an error if a sync is already going on when an auto-sync fires --- chrome/content/zotero/xpcom/sync.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index f254c5c50..a4d5ac93d 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -1039,8 +1039,13 @@ Zotero.Sync.Server = new function () { } // {} implements nsITimerCallback - _autoSyncTimer.initWithCallback({ notify: Zotero.Sync.Server.sync }, - autoSyncTimeout * 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT); + _autoSyncTimer.initWithCallback({ notify: function () { + if (_syncInProgress) { + Zotero.debug('Sync already in progress -- skipping auto-sync'); + return; + } + Zotero.Sync.Server.sync(); + }}, autoSyncTimeout * 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT); }