mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-07 16:32:12 +02:00
Add debugging output for retry wait time (#928)
* Add debugging output for retry wait time
This commit is contained in:
parent
cd07414e7b
commit
b9dd8c754d
|
@ -803,8 +803,7 @@ final class OneDriveApi
|
||||||
auto errorArray = splitLines(e.msg);
|
auto errorArray = splitLines(e.msg);
|
||||||
string errorMessage = errorArray[0];
|
string errorMessage = errorArray[0];
|
||||||
|
|
||||||
if (canFind(errorMessage, "Couldn't connect to server on handle") ||
|
if (canFind(errorMessage, "Couldn't connect to server on handle") || canFind(errorMessage, "Couldn't resolve host name on handle")) {
|
||||||
canFind(errorMessage, "Couldn't resolve host name on handle")) {
|
|
||||||
// This is a curl timeout
|
// This is a curl timeout
|
||||||
log.error(" Error Message: There was a timeout in accessing the Microsoft OneDrive service - Internet connectivity issue?");
|
log.error(" Error Message: There was a timeout in accessing the Microsoft OneDrive service - Internet connectivity issue?");
|
||||||
// or 408 request timeout
|
// or 408 request timeout
|
||||||
|
@ -817,11 +816,13 @@ final class OneDriveApi
|
||||||
bool retrySuccess = false;
|
bool retrySuccess = false;
|
||||||
while (!retrySuccess){
|
while (!retrySuccess){
|
||||||
backoffInterval++;
|
backoffInterval++;
|
||||||
log.vdebug(" Retry Attempt: ", retryAttempts);
|
|
||||||
int thisBackOffInterval = retryAttempts*backoffInterval;
|
int thisBackOffInterval = retryAttempts*backoffInterval;
|
||||||
|
log.vdebug(" Retry Attempt: ", retryAttempts);
|
||||||
if (thisBackOffInterval <= maxBackoffInterval) {
|
if (thisBackOffInterval <= maxBackoffInterval) {
|
||||||
|
log.vdebug(" Retry In (seconds): ", thisBackOffInterval);
|
||||||
Thread.sleep(dur!"seconds"(thisBackOffInterval));
|
Thread.sleep(dur!"seconds"(thisBackOffInterval));
|
||||||
} else {
|
} else {
|
||||||
|
log.vdebug(" Retry In (seconds): ", maxBackoffInterval);
|
||||||
Thread.sleep(dur!"seconds"(maxBackoffInterval));
|
Thread.sleep(dur!"seconds"(maxBackoffInterval));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -830,8 +831,7 @@ final class OneDriveApi
|
||||||
log.log("Internet connectivity to Microsoft OneDrive service has been restored");
|
log.log("Internet connectivity to Microsoft OneDrive service has been restored");
|
||||||
retrySuccess = true;
|
retrySuccess = true;
|
||||||
} catch (CurlException e) {
|
} catch (CurlException e) {
|
||||||
if (canFind(e.msg, "Couldn't connect to server on handle") ||
|
if (canFind(e.msg, "Couldn't connect to server on handle") || canFind(e.msg, "Couldn't resolve host name on handle")) {
|
||||||
canFind(e.msg, "Couldn't resolve host name on handle")) {
|
|
||||||
log.error(" Error Message: There was a timeout in accessing the Microsoft OneDrive service - Internet connectivity issue?");
|
log.error(" Error Message: There was a timeout in accessing the Microsoft OneDrive service - Internet connectivity issue?");
|
||||||
// Increment & loop around
|
// Increment & loop around
|
||||||
retryAttempts++;
|
retryAttempts++;
|
||||||
|
|
Loading…
Reference in a new issue