-
Notifications
You must be signed in to change notification settings - Fork 181
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
feat: provide a mechanism to check if an iroh program is already running #293
Conversation
c63a843
to
95a67ee
Compare
General approach looks good to me, just need to make sure the locking works cross platform in some reasonable manners. |
Do we care about windows? I tested on Mac & Linux so far. |
95a67ee
to
4932172
Compare
@dignifiedquire I switched to https://docs.rs/file-guard/0.1.0/file_guard/ that has the benefits of being cross platform, pure Rust, and to work in our case :) (fslock is not a good fit because its locks are per-handle and not per-process ) |
Thanks, looks great. |
4932172
to
e7fe107
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.
We've had a proper review from dig, and I've checked that all comments are addressed. Looks good!
e7fe107
to
e104640
Compare
This addresses n0-computer/beetle#211 (and #231)
cc @dignifiedquire : I implemented a non opinionated way to acquire a lock and check its state. The example use in iroh-one works as expected so we can generalize to other binaries if the api is fine.