diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index 97c7ea088..b2a0dd080 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -869,7 +869,7 @@ Zotero.Sync.Storage.ZFS = (function () { return; } - if (status == 0) { + if (status == 0 || status == 500 || status == 503) { if (_s3ConsecutiveFailures >= _maxS3ConsecutiveFailures) { Zotero.debug(_s3ConsecutiveFailures + " consecutive S3 failures -- aborting", 1); @@ -921,6 +921,13 @@ Zotero.Sync.Storage.ZFS = (function () { Zotero.debug("Finished download of " + destFile.path); + // Decrease backoff delay on successful download + if (_s3Backoff > 1) { + _s3Backoff /= 2; + } + // And reset consecutive failures + _s3ConsecutiveFailures = 0; + try { deferred.resolve(Zotero.Sync.Storage.processDownload(data)); }