Resolve issue #73 - OneDrive Error 507 Insufficient Storage Exception

* Resolve https://github.com/skilion/onedrive/issues/73 by by tracking
the change in available free disk space when uploading a new file to
OneDrive
This commit is contained in:
abraunegg 2018-04-21 14:54:50 +10:00
parent 82ef982240
commit 7a394a065f

View file

@ -792,10 +792,20 @@ final class SyncEngine
uploadNewItems(entry.name);
}
} else {
Item item;
if (!itemdb.selectByPath(path, defaultDriveId, item)) {
uploadNewFile(path);
}
// This item is a file
// Can we upload this file - is there enough free space? - https://github.com/skilion/onedrive/issues/73
auto fileSize = getSize(path);
if ((remainingFreeSpace - fileSize) > 0){
Item item;
if (!itemdb.selectByPath(path, defaultDriveId, item)) {
uploadNewFile(path);
remainingFreeSpace = (remainingFreeSpace - fileSize);
log.vlog("Remaining free space: ", remainingFreeSpace);
}
} else {
// Not enough free space
log.log("Skipping item '", path, "' due to insufficient free space available on OneDrive");
}
}
} else {
// This path was skipped - why?