Only purge orphaned WebDAV files if downloads completed successfully
This commit is contained in:
parent
d2d5896b0b
commit
db6e9841db
chrome/content/zotero/xpcom/storage
|
@ -262,7 +262,7 @@ Zotero.Sync.Storage.Engine.prototype.start = Zotero.Promise.coroutine(function*
|
||||||
}
|
}
|
||||||
|
|
||||||
// If WebDAV sync, purge orphaned files
|
// If WebDAV sync, purge orphaned files
|
||||||
if (this.controller.mode == 'webdav') {
|
if (downloadSuccessful && this.controller.mode == 'webdav') {
|
||||||
try {
|
try {
|
||||||
yield this.controller.purgeOrphanedStorageFiles(libraryID);
|
yield this.controller.purgeOrphanedStorageFiles(libraryID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1071,7 +1071,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = {
|
||||||
lastModified = Zotero.Date.strToISO(lastModified);
|
lastModified = Zotero.Date.strToISO(lastModified);
|
||||||
lastModified = Zotero.Date.sqlToDate(lastModified, true);
|
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;
|
var days = (lastSyncDate - lastModified) / 1000 / 60 / 60 / 24;
|
||||||
|
|
||||||
if (days > daysBeforeSyncTime) {
|
if (days > daysBeforeSyncTime) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user