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

My program stops getting events after some time #545

Closed
ShayBox opened this issue Nov 4, 2023 · 2 comments
Closed

My program stops getting events after some time #545

ShayBox opened this issue Nov 4, 2023 · 2 comments

Comments

@ShayBox
Copy link

ShayBox commented Nov 4, 2023

I use notify-rs in my VRC-LOG project here and here

I'm on Windows 11 23H2 using the latest version of notify-rs and my program stops getting events after about 10–30 minutes, do you know what might be causing this? This has been a problem since the start of my project, it's not new.

I tried adding prints to the callbacks, but they just stopped getting events altogether.

EDIT: Though I ignore send errors now, I previously unwrapped and never found an exception.

@0xpr03
Copy link
Member

0xpr03 commented Nov 5, 2023

Looks like a duplicate of #482. You have to keep the watcher around. Dropping it like here stops the event loop. See also variable scopes for why your watcher is gone at the end of that scope/function.

@ShayBox
Copy link
Author

ShayBox commented Nov 5, 2023

Ah, that makes sense... I discovered the same thing about the channels, but didn't occur to me the watcher is the same. 🤦 Thank you

@ShayBox ShayBox closed this as completed Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants