commit 0ebf49849a20ab65160c6baabe90b890dce5bfbd parent 1a97f27fe3acb0ab3b85dc5584f76c05e8ac53cf Author: Dan Stillman <dstillman@zotero.org> Date: Wed, 27 Apr 2016 02:35:24 -0400 Log counts of storage requests that succeeded and failed Diffstat:
| M | chrome/content/zotero/xpcom/storage/storageEngine.js | | | 16 | ++++++++++++---- |
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/chrome/content/zotero/xpcom/storage/storageEngine.js b/chrome/content/zotero/xpcom/storage/storageEngine.js @@ -212,17 +212,25 @@ Zotero.Sync.Storage.Engine.prototype.start = Zotero.Promise.coroutine(function* var changes = new Zotero.Sync.Storage.Result; for (let type of ['download', 'upload']) { let results = yield promises[type]; + let succeeded = 0; + let failed = 0; - if (this.stopOnError) { - for (let p of results) { - if (p.isRejected()) { + for (let p of results) { + if (p.isFulfilled()) { + succeeded++; + } + else { + if (this.stopOnError) { let e = p.reason(); Zotero.debug(`File ${type} sync failed for ${this.library.name}`); throw e; } + failed++; } } - Zotero.debug(`File ${type} sync finished for ${this.library.name}`); + + Zotero.debug(`File ${type} sync finished for ${this.library.name} ` + + `(${succeeded} succeeded, ${failed} failed)`); changes.updateFromResults(results.filter(p => p.isFulfilled()).map(p => p.value()));