From 4d25e68c65bf13533c91cb4d2917777a60f089f0 Mon Sep 17 00:00:00 2001 From: Kleckkinator Date: Tue, 9 Nov 2021 14:46:41 -0600 Subject: [PATCH] Added operation_timeout as a new configuration (#1685) * Added operation_timeout as a new configuration --- docs/USAGE.md | 11 +++++++++++ src/config.d | 4 ++++ src/onedrive.d | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/USAGE.md b/docs/USAGE.md index 56ad6d01..19ba520d 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -26,6 +26,7 @@ + [skip_symlinks](#skip_symlinks) + [monitor_interval](#monitor_interval) + [min_notify_changes](#min_notify_changes) + + [operation_timeout](#operation_timeout) + [Selective sync via 'sync_list' file](#selective-sync-via-sync_list-file) * [Configuring the client for 'single tenant application' use](#configuring-the-client-for-single-tenant-application-use) * [Configuring the client to use older 'skilion' application identifier](#configuring-the-client-to-use-older-skilion-application-identifier) @@ -351,6 +352,7 @@ See the [config](https://raw.githubusercontent.com/abraunegg/onedrive/master/con # sync_dir_permissions = "700" # sync_file_permissions = "600" # rate_limit = "131072" +# operation_timeout = "3600" ``` @@ -510,6 +512,15 @@ min_notify_changes = "50" ``` This option defines the minimum number of pending incoming changes necessary to trigger a desktop notification. This allows controlling the frequency of notifications. +#### operation_timeout +Example: +```text +# sync_file_permissions = "600" +# rate_limit = "131072" +operation_timeout = "3600" +``` +Operation Timeout is the maximum amount of time (seconds) a file operation is allowed to take. This includes DNS resolution, connecting, data transfer, etc. + #### Selective sync via 'sync_list' file Selective sync allows you to sync only specific files and directories. To enable selective sync create a file named `sync_list` in `~/.config/onedrive`. diff --git a/src/config.d b/src/config.d index 4b13c4e6..30bb922b 100644 --- a/src/config.d +++ b/src/config.d @@ -132,6 +132,10 @@ final class Config // - It may be desirable to see what options are being passed in to performSync() without enabling the full verbose debug logging boolValues["display_sync_options"] = false; + // maximum time an operation is allowed to take + // This includes dns resolution, connecting, data transfer, etc. + longValues["operation_timeout"] = 3600; + // Determine the users home directory. // Need to avoid using ~ here as expandTilde() below does not interpret correctly when running under init.d or systemd scripts // Check for HOME environment variable diff --git a/src/onedrive.d b/src/onedrive.d index 46f82f07..8c89ec3d 100644 --- a/src/onedrive.d +++ b/src/onedrive.d @@ -131,7 +131,7 @@ final class OneDriveApi http.dataTimeout = (dur!"seconds"(600)); // maximum time an operation is allowed to take // This includes dns resolution, connecting, data transfer, etc. - http.operationTimeout = (dur!"seconds"(3600)); + http.operationTimeout = (dur!"seconds"(cfg.getValueLong("operation_timeout"))); // Specify how many redirects should be allowed http.maxRedirects(5);