-
Notifications
You must be signed in to change notification settings - Fork 70
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
check if cache loop task is running before starting new thread #39
base: dev
Are you sure you want to change the base?
Conversation
…ch poison error
I'm very sorry for the linting, clippy doing it's thing 🤷 |
I don't think this should be merged. At least not yet.As stated here #26 (comment) this would be a work around. We could possibly fix the thing causing the panic instead of just spawning a new thread every 30 seconds needlessly. |
Nevermind I forgot I could edit it 🤦♂️I agree with Raph that we shouldn't merge this as we need it fully tested first. |
…en old one is still running
I merged the dev branch into my branch and added a task_running flag to check if the old thread is still running. |
I will test this with a Mac user later in addition to #33. Also please make sure you claim issues by pinging me in the comments so I can assign you. This is just in case someone is already working on it. Duplicate PRs have occurred few times before so I'll work on some contribution guidelines. Thanks for your help! |
interval.tick().await; // Wait 30 seconds before doing first re-cache | ||
|
||
loop { | ||
interval.tick().await; | ||
|
||
let guard = &mut state_clone.lock().unwrap(); | ||
save_to_cache(guard); | ||
if !task_running.load(Ordering::SeqCst) { |
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.
Shouldn't this be swap instead?
Fixes #26, resolves #41