mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-15 20:25:18 +02:00
Update PR
* Update PR
This commit is contained in:
parent
760b3c81b2
commit
54b3d52703
10
src/config.d
10
src/config.d
|
@ -319,9 +319,9 @@ class ApplicationConfig {
|
|||
boolValues["webhook_enabled"] = false;
|
||||
|
||||
// Print in debug the application version as soon as possible
|
||||
|
||||
//log.vdebug("Application Version: ", strip(import("version")));
|
||||
log.vdebug("Application Version: v2.5.0-alpha-0");
|
||||
string tempVersion = "v2.5.0-alpha-0" ~ " GitHub version: " ~ strip(import("version"));
|
||||
log.vdebug("Application Version: ", tempVersion);
|
||||
|
||||
// EXPAND USERS HOME DIRECTORY
|
||||
// Determine the users home directory.
|
||||
|
@ -1089,7 +1089,11 @@ class ApplicationConfig {
|
|||
}
|
||||
|
||||
// Display application version
|
||||
writeln("onedrive version = ", strip(import("version")));
|
||||
//writeln("onedrive version = ", strip(import("version")));
|
||||
|
||||
string tempVersion = "v2.5.0-alpha-0" ~ " GitHub version: " ~ strip(import("version"));
|
||||
writeln("onedrive version = ", tempVersion);
|
||||
|
||||
// Display all of the pertinent configuration options
|
||||
writeln("Config path = ", configDirName);
|
||||
// Does a config file exist or are we using application defaults
|
||||
|
|
|
@ -110,7 +110,8 @@ int main(string[] cliArgs) {
|
|||
// Print the version and exit
|
||||
if (printVersion) {
|
||||
//writeln("onedrive ", strip(import("version")));
|
||||
writeln("onedrive v2.5.0-alpha-0");
|
||||
string tempVersion = "v2.5.0-alpha-0" ~ " GitHub version: " ~ strip(import("version"));
|
||||
writeln(tempVersion);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
} catch (GetOptException e) {
|
||||
|
|
49
src/sync.d
49
src/sync.d
|
@ -294,7 +294,7 @@ class SyncEngine {
|
|||
Thread.sleep(dur!"seconds"(30));
|
||||
}
|
||||
// re-try original request - retried for 429 and 504 - but loop back calling this function
|
||||
log.vdebug("Retrying Query: getDefaultDriveDetails()");
|
||||
log.vdebug("Retrying Function: getDefaultDriveDetails()");
|
||||
getDefaultDriveDetails();
|
||||
} else {
|
||||
// Default operation if not 408,429,503,504 errors
|
||||
|
@ -458,7 +458,7 @@ class SyncEngine {
|
|||
Thread.sleep(dur!"seconds"(30));
|
||||
}
|
||||
// re-try original request - retried for 429, 503, 504 - but loop back calling this function
|
||||
log.vdebug("Retrying Query: getDefaultRootDetails()");
|
||||
log.vdebug("Retrying Function: getDefaultRootDetails()");
|
||||
getDefaultRootDetails();
|
||||
} else {
|
||||
// Default operation if not 408,429,503,504 errors
|
||||
|
@ -3657,10 +3657,8 @@ class SyncEngine {
|
|||
// thus, the entries are not in the dry-run DB copy, thus, at this point the client thinks that this is an item to upload
|
||||
// Check this 'path' for an entry in pathFakeDeletedArray - if it is there, this is unwanted
|
||||
if (dryRun) {
|
||||
// Is this path in the array of fake deleted items?
|
||||
unwanted = canFind(pathFakeDeletedArray, path);
|
||||
// Return early, nothing else to do
|
||||
return;
|
||||
// Is this path in the array of fake deleted items? If yes, return early, nothing else to do, save processing
|
||||
if (canFind(pathFakeDeletedArray, path)) return;
|
||||
}
|
||||
|
||||
// This not a Client Side Filtering check, nor a Microsoft Check, but is a sanity check that the path provided is UTF encoded correctly
|
||||
|
@ -5473,8 +5471,12 @@ class SyncEngine {
|
|||
Thread.sleep(dur!"seconds"(30));
|
||||
}
|
||||
// re-try original request - retried for 429, 503, 504 - but loop back calling this function
|
||||
log.vdebug("Retrying Query: generateDeltaResponseOneDriveApiInstance.listChildren(searchItem.driveId, searchItem.id, nextLink)");
|
||||
topLevelChildren = generateDeltaResponseOneDriveApiInstance.listChildren(searchItem.driveId, searchItem.id, nextLink);
|
||||
//log.vdebug("Retrying Query: generateDeltaResponseOneDriveApiInstance.listChildren(searchItem.driveId, searchItem.id, nextLink)");
|
||||
//topLevelChildren = generateDeltaResponseOneDriveApiInstance.listChildren(searchItem.driveId, searchItem.id, nextLink);
|
||||
|
||||
log.vdebug("Retrying Function: ", thisFunctionName);
|
||||
generateDeltaResponse(pathToQuery);
|
||||
|
||||
} else {
|
||||
// Default operation if not 408,429,503,504 errors
|
||||
// display what the error is
|
||||
|
@ -5633,8 +5635,23 @@ class SyncEngine {
|
|||
|
||||
for (;;) {
|
||||
// query children
|
||||
|
||||
try {
|
||||
|
||||
thisLevelChildren = queryThisLevelChildren(driveId, idToQuery, nextLink);
|
||||
|
||||
} catch (OneDriveException exception) {
|
||||
|
||||
|
||||
writeln("EXCEPTION HANDLING NEEDED: thisLevelChildren = queryThisLevelChildren(driveId, idToQuery, nextLink)");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Was a valid JSON response for 'thisLevelChildren' provided?
|
||||
if (thisLevelChildren.type() == JSONType.object) {
|
||||
|
||||
// process this level children
|
||||
if (!childParentPath.empty) {
|
||||
// We dont use childParentPath to log, as this poses an information leak risk.
|
||||
|
@ -5676,6 +5693,15 @@ class SyncEngine {
|
|||
nextLink = thisLevelChildren["@odata.nextLink"].str;
|
||||
log.vdebug("Setting nextLink to (@odata.nextLink): ", nextLink);
|
||||
} else break;
|
||||
|
||||
} else {
|
||||
|
||||
// driveData is an invalid JSON object
|
||||
writeln("CODING TO DO: The query of OneDrive API to thisLevelChildren = queryThisLevelChildren(driveId, idToQuery, nextLink) generated an invalid JSON response - thus we cant build our own /delta simulated response ... how to handle?");
|
||||
// Must exit here
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// return response
|
||||
|
@ -5735,8 +5761,11 @@ class SyncEngine {
|
|||
Thread.sleep(dur!"seconds"(30));
|
||||
}
|
||||
// re-try original request - retried for 429, 503, 504 - but loop back calling this function
|
||||
log.vdebug("Retrying Query: thisLevelChildren = queryThisLevelChildren(driveId, idToQuery, nextLink)");
|
||||
thisLevelChildren = queryThisLevelChildren(driveId, idToQuery, nextLink);
|
||||
//log.vdebug("Retrying Query: thisLevelChildren = queryThisLevelChildren(driveId, idToQuery, nextLink)");
|
||||
//thisLevelChildren = queryThisLevelChildren(driveId, idToQuery, nextLink);
|
||||
log.vdebug("Retrying Function: ", thisFunctionName);
|
||||
queryThisLevelChildren(driveId, idToQuery, nextLink);
|
||||
|
||||
} else {
|
||||
// Default operation if not 408,429,503,504 errors
|
||||
// display what the error is
|
||||
|
|
Loading…
Reference in a new issue