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

Introduce --ignore-mutex option #20

Merged
merged 3 commits into from
Jan 1, 2024
Merged

Introduce --ignore-mutex option #20

merged 3 commits into from
Jan 1, 2024

Conversation

rodja
Copy link
Member

@rodja rodja commented Dec 31, 2023

This PR introduces an option to ignore the mutex. This option is quite dangerous but can be useful if you know what you are doing.

Example: two colleagues are preparing a system for delivery; one is developing the main code and has acquired the sync-mutex. But the other one wants to test some peripherals on the same system. By using the ignore-mutex option and syncing into an agreed folder the work can still be performed in parallel.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@rodja rodja added this to the 0.3.2 milestone Dec 31, 2023
@rodja rodja added the enhancement New feature or request label Dec 31, 2023
Copy link
Contributor

@falkoschindler falkoschindler left a comment

Choose a reason for hiding this comment

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

Ok, I just wonder why you use await asyncio.sleep(0) instead of, e.g., await asyncio.sleep(mutex_interval). What exactly is sleep(0) doing?

@rodja
Copy link
Member Author

rodja commented Dec 31, 2023

@falkoschindler you are right! asyncio.sleep(0) was to yield control of the main loop. But of course that can be coded in a simpler way!

@rodja rodja requested a review from falkoschindler December 31, 2023 12:26
Copy link
Contributor

@falkoschindler falkoschindler left a comment

Choose a reason for hiding this comment

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

Now we can move the if condition out of the while loop, can't we?

Ah, we need the sleep to keep LiceSync running.

@falkoschindler falkoschindler merged commit e8f3a0d into main Jan 1, 2024
1 check passed
@falkoschindler falkoschindler deleted the ignore_mutex branch January 1, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants