mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-08 08:52:15 +02:00
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:
parent
82ef982240
commit
7a394a065f
18
src/sync.d
18
src/sync.d
|
@ -792,10 +792,20 @@ final class SyncEngine
|
||||||
uploadNewItems(entry.name);
|
uploadNewItems(entry.name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Item item;
|
// This item is a file
|
||||||
if (!itemdb.selectByPath(path, defaultDriveId, item)) {
|
// Can we upload this file - is there enough free space? - https://github.com/skilion/onedrive/issues/73
|
||||||
uploadNewFile(path);
|
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 {
|
} else {
|
||||||
// This path was skipped - why?
|
// This path was skipped - why?
|
||||||
|
|
Loading…
Reference in a new issue