mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-29 03:52:27 +02:00
continue in monitor mode when sync timed out (#265)
* update handling of connection timeouts in monitor mode & allow application continue rather than exit
This commit is contained in:
parent
c24e4b0b1e
commit
9817104ca1
13
src/main.d
13
src/main.d
|
@ -382,10 +382,15 @@ int main(string[] args)
|
||||||
online = false;
|
online = false;
|
||||||
}
|
}
|
||||||
if (online) {
|
if (online) {
|
||||||
performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly);
|
try {
|
||||||
if (!downloadOnly) {
|
performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly);
|
||||||
// discard all events that may have been generated by the sync
|
if (!downloadOnly) {
|
||||||
m.update(false);
|
// discard all events that may have been generated by the sync
|
||||||
|
m.update(false);
|
||||||
|
}
|
||||||
|
} catch (CurlException e) {
|
||||||
|
// TODO better check of type of exception from Curl
|
||||||
|
log.log("No network connection to Microsoft OneDrive Service, skipping sync");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// performSync complete, set lastCheckTime to current time
|
// performSync complete, set lastCheckTime to current time
|
||||||
|
|
|
@ -523,7 +523,7 @@ final class OneDriveApi
|
||||||
} catch (CurlException e) {
|
} catch (CurlException e) {
|
||||||
// Potentially Timeout was reached on handle error
|
// Potentially Timeout was reached on handle error
|
||||||
log.error("\nAccess to the Microsoft OneDrive service timed out - Internet connectivity issue?\n");
|
log.error("\nAccess to the Microsoft OneDrive service timed out - Internet connectivity issue?\n");
|
||||||
exit(-1);
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONValue json;
|
JSONValue json;
|
||||||
|
|
Loading…
Reference in a new issue