mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-15 20:25:18 +02:00
Add National Cloud Deployment to flag /children scan
* Add National Cloud Deployment to flag /children scan
This commit is contained in:
parent
26f92b6191
commit
106b5c3068
|
@ -1379,6 +1379,13 @@ class ApplicationConfig {
|
||||||
addLogEntry("Config option 'webhook_retry_interval' = " ~ to!string(getValueLong("webhook_retry_interval")));
|
addLogEntry("Config option 'webhook_retry_interval' = " ~ to!string(getValueLong("webhook_retry_interval")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getValueBool("display_running_config")) {
|
||||||
|
addLogEntry();
|
||||||
|
addLogEntry("--------------------DEVELOPER_OPTIONS----------------------------");
|
||||||
|
addLogEntry("Config option 'force_children_scan' = " ~ to!string(getValueBool("force_children_scan")));
|
||||||
|
addLogEntry();
|
||||||
|
}
|
||||||
|
|
||||||
if (getValueBool("display_running_config")) {
|
if (getValueBool("display_running_config")) {
|
||||||
addLogEntry("-----------------------------------------------------------------");
|
addLogEntry("-----------------------------------------------------------------");
|
||||||
}
|
}
|
||||||
|
|
12
src/main.d
12
src/main.d
|
@ -157,7 +157,7 @@ int main(string[] cliArgs) {
|
||||||
addLogEntry("Basic 'Console only with no new line' message", ["consoleOnlyNoNewLine"]);
|
addLogEntry("Basic 'Console only with no new line' message", ["consoleOnlyNoNewLine"]);
|
||||||
**/
|
**/
|
||||||
|
|
||||||
// Log application start time
|
// Log application start time, log line has start time
|
||||||
addLogEntry("Application started", ["debug"]);
|
addLogEntry("Application started", ["debug"]);
|
||||||
|
|
||||||
// Who are we running as? This will print the ProcessID, UID, GID and username the application is running as
|
// Who are we running as? This will print the ProcessID, UID, GID and username the application is running as
|
||||||
|
@ -366,7 +366,7 @@ int main(string[] cliArgs) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implement https://github.com/abraunegg/onedrive/issues/1129
|
// Implement https://github.com/abraunegg/onedrive/issues/1129
|
||||||
// Force a synchronization of a specific folder, only when using --synchronize --single-directory and ignoring all non-default skip_dir and skip_file rules
|
// Force a synchronisation of a specific folder, only when using --synchronize --single-directory and ignoring all non-default skip_dir and skip_file rules
|
||||||
if (appConfig.getValueBool("force_sync")) {
|
if (appConfig.getValueBool("force_sync")) {
|
||||||
// appConfig.checkForBasicOptionConflicts() has already checked for the basic requirements for --force-sync
|
// appConfig.checkForBasicOptionConflicts() has already checked for the basic requirements for --force-sync
|
||||||
addLogEntry();
|
addLogEntry();
|
||||||
|
@ -426,6 +426,8 @@ int main(string[] cliArgs) {
|
||||||
addLogEntry("Attempting to initialise the OneDrive API ...", ["verbose"]);
|
addLogEntry("Attempting to initialise the OneDrive API ...", ["verbose"]);
|
||||||
OneDriveApi oneDriveApiInstance = new OneDriveApi(appConfig);
|
OneDriveApi oneDriveApiInstance = new OneDriveApi(appConfig);
|
||||||
appConfig.apiWasInitialised = oneDriveApiInstance.initialise();
|
appConfig.apiWasInitialised = oneDriveApiInstance.initialise();
|
||||||
|
|
||||||
|
// Did the API initialise successfully?
|
||||||
if (appConfig.apiWasInitialised) {
|
if (appConfig.apiWasInitialised) {
|
||||||
addLogEntry("The OneDrive API was initialised successfully", ["verbose"]);
|
addLogEntry("The OneDrive API was initialised successfully", ["verbose"]);
|
||||||
|
|
||||||
|
@ -619,7 +621,7 @@ int main(string[] cliArgs) {
|
||||||
|
|
||||||
// Configure the sync direcory based on the runtimeSyncDirectory configured directory
|
// Configure the sync direcory based on the runtimeSyncDirectory configured directory
|
||||||
addLogEntry("All application operations will be performed in the configured local 'sync_dir' directory: " ~ runtimeSyncDirectory, ["verbose"]);
|
addLogEntry("All application operations will be performed in the configured local 'sync_dir' directory: " ~ runtimeSyncDirectory, ["verbose"]);
|
||||||
|
// Try and set the 'sync_dir', attempt to create if it does not exist
|
||||||
try {
|
try {
|
||||||
if (!exists(runtimeSyncDirectory)) {
|
if (!exists(runtimeSyncDirectory)) {
|
||||||
addLogEntry("runtimeSyncDirectory: Configured 'sync_dir' is missing locally. Creating: " ~ runtimeSyncDirectory, ["debug"]);
|
addLogEntry("runtimeSyncDirectory: Configured 'sync_dir' is missing locally. Creating: " ~ runtimeSyncDirectory, ["debug"]);
|
||||||
|
@ -1287,6 +1289,9 @@ void performStandardSyncProcess(string localPath, Monitor filesystemMonitor = nu
|
||||||
itemDB.performVacuum();
|
itemDB.performVacuum();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we are not doing a 'force_children_scan' perform a true-up
|
||||||
|
// 'force_children_scan' is used when using /children rather than /delta and it is not efficent to re-run this exact same process twice
|
||||||
|
if (!appConfig.getValueBool("force_children_scan")) {
|
||||||
// Perform the final true up scan to ensure we have correctly replicated the current online state locally
|
// Perform the final true up scan to ensure we have correctly replicated the current online state locally
|
||||||
if (!appConfig.surpressLoggingOutput) {
|
if (!appConfig.surpressLoggingOutput) {
|
||||||
addLogEntry("Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process");
|
addLogEntry("Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process");
|
||||||
|
@ -1301,6 +1306,7 @@ void performStandardSyncProcess(string localPath, Monitor filesystemMonitor = nu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void displaySyncOutcome() {
|
void displaySyncOutcome() {
|
||||||
|
|
||||||
|
|
14
src/sync.d
14
src/sync.d
|
@ -244,6 +244,20 @@ class SyncEngine {
|
||||||
this.noRemoteDelete = true;
|
this.noRemoteDelete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Are we configured to use a National Cloud Deployment?
|
||||||
|
if (appConfig.getValueString("azure_ad_endpoint") != "") {
|
||||||
|
// value is configured, is it a valid value?
|
||||||
|
if ((appConfig.getValueString("azure_ad_endpoint") == "USL4") || (appConfig.getValueString("azure_ad_endpoint") == "USL5") || (appConfig.getValueString("azure_ad_endpoint") == "DE") || (appConfig.getValueString("azure_ad_endpoint") == "CN")) {
|
||||||
|
// valid entries to flag we are using a National Cloud Deployment
|
||||||
|
// National Cloud Deployments do not support /delta as a query
|
||||||
|
// https://docs.microsoft.com/en-us/graph/deployments#supported-features
|
||||||
|
// Flag that we have a valid National Cloud Deployment that cannot use /delta queries
|
||||||
|
this.nationalCloudDeployment = true;
|
||||||
|
// Reverse set 'force_children_scan' for completeness
|
||||||
|
appConfig.setValueBool("force_children_scan", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Are we forcing to use /children scan instead of /delta to simulate National Cloud Deployment use of /children?
|
// Are we forcing to use /children scan instead of /delta to simulate National Cloud Deployment use of /children?
|
||||||
if (appConfig.getValueBool("force_children_scan")) {
|
if (appConfig.getValueBool("force_children_scan")) {
|
||||||
addLogEntry("Forcing client to use /children API call rather than /delta API to retrieve objects from the OneDrive API");
|
addLogEntry("Forcing client to use /children API call rather than /delta API to retrieve objects from the OneDrive API");
|
||||||
|
|
Loading…
Reference in a new issue