Skip to content

Commit

Permalink
Only purge orphaned WebDAV files if downloads completed successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Jun 14, 2017
1 parent d2d5896 commit db6e984
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chrome/content/zotero/xpcom/storage/storageEngine.js
Expand Up @@ -262,7 +262,7 @@ Zotero.Sync.Storage.Engine.prototype.start = Zotero.Promise.coroutine(function*
}

// If WebDAV sync, purge orphaned files
if (this.controller.mode == 'webdav') {
if (downloadSuccessful && this.controller.mode == 'webdav') {
try {
yield this.controller.purgeOrphanedStorageFiles(libraryID);
}
Expand Down
2 changes: 1 addition & 1 deletion chrome/content/zotero/xpcom/storage/webdav.js
Expand Up @@ -1071,7 +1071,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = {
lastModified = Zotero.Date.strToISO(lastModified);
lastModified = Zotero.Date.sqlToDate(lastModified, true);

// Delete files older than a day before last sync time
// Delete files older than a week before last sync time
var days = (lastSyncDate - lastModified) / 1000 / 60 / 60 / 24;

if (days > daysBeforeSyncTime) {
Expand Down

0 comments on commit db6e984

Please sign in to comment.