Handle short lived files (Issue #273) (PR #274)

* Handle short lived files (Issue #273)
* Update README.md
* Add --disable-notifications to readme
This commit is contained in:
abraunegg 2018-12-06 10:50:46 +11:00 committed by Norbert Preining
parent cc6cbf5ac7
commit 0562c52492
3 changed files with 13 additions and 0 deletions

View file

@ -481,6 +481,7 @@ no option No sync and exit
--create-directory Create a directory on OneDrive - no sync will be performed.
--destination-directory Destination directory for renamed or move on OneDrive - no sync will be performed.
--debug-https Debug OneDrive HTTPS communication.
--disable-notifications Do not use desktop notifications in monitor mode.
-d --download-only Only download remote changes
--disable-upload-validation Disable upload validation when uploading to OneDrive
--enable-logging Enable client activity to a separate log file

View file

@ -365,6 +365,12 @@ int main(string[] args)
log.vlog("[M] Item deleted: ", path);
try {
sync.deleteByPath(path);
} catch(SyncException e) {
if (e.msg == "The item to delete is not in the local database") {
log.vlog("Item cannot be deleted because not found in database");
} else {
log.logAndNotify(e.msg);
}
} catch(Exception e) {
log.logAndNotify(e.msg);
}

View file

@ -1177,6 +1177,12 @@ final class SyncEngine
maxPathLength = 430;
}
// A short lived file that has disappeared will cause an error - is the path valid?
if (!exists(path)) {
log.log("Skipping item - has disappeared: ", path);
return;
}
if(path.byGrapheme.walkLength < maxPathLength){
// path is less than maxPathLength