Skip to content

Commit

Permalink
continue in monitor mode when sync timed out (#265)
Browse files Browse the repository at this point in the history
* update handling of connection timeouts in monitor mode & allow application continue rather than exit
  • Loading branch information
norbusan authored and abraunegg committed Dec 3, 2018
1 parent c24e4b0 commit 9817104
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,15 @@ int main(string[] args)
online = false;
}
if (online) {
performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly);
if (!downloadOnly) {
// discard all events that may have been generated by the sync
m.update(false);
try {
performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly);
if (!downloadOnly) {
// 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
Expand Down
2 changes: 1 addition & 1 deletion src/onedrive.d
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ final class OneDriveApi
} catch (CurlException e) {
// Potentially Timeout was reached on handle error
log.error("\nAccess to the Microsoft OneDrive service timed out - Internet connectivity issue?\n");
exit(-1);
throw e;
}

JSONValue json;
Expand Down

0 comments on commit 9817104

Please sign in to comment.