-
-
Notifications
You must be signed in to change notification settings - Fork 872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow starting offline in monitor mode #266
Conversation
873166e
to
de4d52e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you review the comments - I have a feeling the http object will need to be shutdown before exit
de4d52e
to
81323c3
Compare
I added the missing shutdown, and rebased on master |
always call initSyncEngine during regular syncs, this will call the SyncEngine init routine which caches the state, thus a quasi no-op.
81323c3
to
a515fdf
Compare
Thanks a lot! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This pull requests allows for startup of onedrive in monitor mode while the computer is offline. The pull request is split into three commits to make the changes more understandable.
The first commit ensures that the SyncEngine's init function can be called repeatedly by caching the success state in a private boolean.
The second commit factors out the initialization of the sync engine and handling of exceptions into a separate function that will be reused later on.
The last commit changes the sync routine of the monitor mode that during the start the sync engine is initialized via the previously factored out function. In case it is ready, this is a (quasi) noop. The commit also reduces the double try/catch on CurlException in the sync routine (formerly used to check whether online). We can later add better logging to provide feedback what might have been the error.
With these changes onedrive can start while being offline, and start syncing as soon as the connection becomes available.