mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-04 23:12:18 +02:00
gracefully handle connection errors in monitor mode (#253)
* gracefully handle connection errors, resolve issue #234
This commit is contained in:
parent
859b5510a0
commit
11138602ed
|
@ -374,7 +374,13 @@ int main(string[] args)
|
||||||
if (!downloadOnly) m.update(online);
|
if (!downloadOnly) m.update(online);
|
||||||
auto currTime = MonoTime.currTime();
|
auto currTime = MonoTime.currTime();
|
||||||
if (currTime - lastCheckTime > checkInterval) {
|
if (currTime - lastCheckTime > checkInterval) {
|
||||||
online = testNetwork();
|
try {
|
||||||
|
online = testNetwork();
|
||||||
|
} catch (CurlException e) {
|
||||||
|
// No network connection to OneDrive Service
|
||||||
|
log.log("No network connection to Microsoft OneDrive Service, skipping sync");
|
||||||
|
online = false;
|
||||||
|
}
|
||||||
if (online) {
|
if (online) {
|
||||||
performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly);
|
performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly);
|
||||||
if (!downloadOnly) {
|
if (!downloadOnly) {
|
||||||
|
|
Loading…
Reference in a new issue