Only purge orphaned WebDAV files if downloads completed successfully

This commit is contained in:
Dan Stillman 2017-06-14 00:41:21 -04:00
parent d2d5896b0b
commit db6e9841db
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -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) {