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

Using a duration value less than 500ms #89

Open
binkabir opened this issue Nov 12, 2024 · 2 comments
Open

Using a duration value less than 500ms #89

binkabir opened this issue Nov 12, 2024 · 2 comments

Comments

@binkabir
Copy link

Hello @mvniekerk
Thanks for this awesome library.
I need a bit of clarification on the minimum possible value of the Duration for Job::new_repeated_async function. From the source code
it stated that a new job will only be created after the delay of 500ms
Create a new async repeated job. This is checked if it is running only after 500ms in 500ms intervals. let mut sched = JobScheduler::new(); let job = Job::new_repeated_async(Duration::from_secs(8), |_uuid, _lock| Box::pin(async move { println!("{:?} I'm repeated every 8 seconds", chrono::Utc::now()); })); sched.add(job) tokio::spawn(sched.start());

Does this mean that we cannot have a repeated scheduler with duration less than 500ms ?

Thanks

@mvniekerk
Copy link
Owner

mvniekerk commented Nov 12, 2024 via email

@binkabir
Copy link
Author

I see. having the default value as a config can be a good idea. I'm constrained to us this for scheduler that are meant to run in less than 100ms. Thanks for the quick response

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

No branches or pull requests

2 participants