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

dont queue up presence detections #2022

Conversation

James-Pickett
Copy link
Contributor

No description provided.

@James-Pickett James-Pickett changed the title use try lock for presence detection in presence detector dont queue up presence detections Jan 2, 2025
@James-Pickett James-Pickett marked this pull request as ready for review January 2, 2025 19:52
RebeccaMahany
RebeccaMahany previously approved these changes Jan 2, 2025
// using try lock here because we don't want presence detections to queue up,
// in the event that the users presses cancel, if the request were queued up, it would
// request the presence detection again
if !pd.mutex.TryLock() {
Copy link
Contributor Author

@James-Pickett James-Pickett Jan 2, 2025

Choose a reason for hiding this comment

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

actually, this seems racy, may need 2 mutexes here, one for the lastDetection value and one for actually prompting the user then just try lock the actual prompting

@James-Pickett
Copy link
Contributor Author

not working as expected, will reopen after some tweaks

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