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

chore: conditionally start file sync daemon #115

Merged
merged 2 commits into from
Mar 24, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Mar 20, 2025

This makes a few improvements to #98:

  • The mutagen path & data directory can be now be configured on the MutagenDaemon, to support overriding it in tests (coming soon).
  • A mutagen daemon failure now kills the process, such that can it be restarted (TBC).
  • Makes start & stop transitions mutually exclusive via a semaphore, to account for actor re-entrancy.
  • The start operation now waits for the daemon to respond to a version request before completing.
  • The daemon is always started on launch, but then immediately stopped if it doesn't manage any file sync sessions, as to not run in the background unncessarily.

if state.startVPNOnLaunch {
vpn.startWhenReady = true
}
vpn.installSystemExtension()
fileSyncDaemon = MutagenDaemon(
mutagenPath: Bundle.main.url(forResource: "mutagen-darwin-arm64", withExtension: nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be CPU arch-specific?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True!

Copy link
Member

@ThomasK33 ThomasK33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, if the platform-specific binary gets fetched, this can get merged.
No need to re-review.

Copy link
Member Author

ethanndickson commented Mar 24, 2025

Merge activity

  • Mar 24, 5:49 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Mar 24, 5:49 AM EDT: A user merged this pull request with Graphite.

@ethanndickson ethanndickson merged commit 4fb7970 into main Mar 24, 2025
3 of 4 checks passed
@ethanndickson ethanndickson deleted the ethan/conditionally-start-daemon branch March 24, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants