Skip to content
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

Merged
merged 4 commits into from
Dec 4, 2018

Conversation

norbusan
Copy link
Collaborator

@norbusan norbusan commented Dec 3, 2018

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.

@norbusan norbusan force-pushed the issue257-start-offline branch from 873166e to de4d52e Compare December 3, 2018 08:44
Copy link
Owner

@abraunegg abraunegg left a 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

src/main.d Show resolved Hide resolved
src/main.d Show resolved Hide resolved
@norbusan norbusan force-pushed the issue257-start-offline branch from de4d52e to 81323c3 Compare December 3, 2018 23:29
@norbusan
Copy link
Collaborator Author

norbusan commented Dec 3, 2018

I added the missing shutdown, and rebased on master

@norbusan norbusan force-pushed the issue257-start-offline branch from 81323c3 to a515fdf Compare December 3, 2018 23:42
@norbusan norbusan dismissed abraunegg’s stale review December 4, 2018 00:07

Changes applied and rebased

@abraunegg abraunegg self-requested a review December 4, 2018 00:11
@abraunegg abraunegg merged commit b10e641 into abraunegg:master Dec 4, 2018
@norbusan
Copy link
Collaborator Author

norbusan commented Dec 4, 2018

Thanks a lot!

@norbusan norbusan deleted the issue257-start-offline branch December 4, 2018 00:25
@lorenzosu lorenzosu mentioned this pull request Dec 13, 2018
3 tasks
@lock
Copy link

lock bot commented Jan 5, 2019

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.

@lock lock bot locked and limited conversation to collaborators Jan 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants