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

[Feature] Add method to change schedule #71

Open
JosiahParry opened this issue Jul 28, 2024 · 2 comments
Open

[Feature] Add method to change schedule #71

JosiahParry opened this issue Jul 28, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@JosiahParry
Copy link

It would be quite nice to be able to have a method that allows you to change the schedule of a job based on aUuid and a new cron schedule.

I can imagine a UI something like so:

let mut sched = JobScheduler::new().await?;

// Add basic cron job
let uuid = sched.add(
    Job::new("1/10 * * * * *", |_uuid, _l| {
        println!("I run every 10 seconds");
    })?
).await?;

let _ = sched.reschedule(&uuid, "10 * * * * *").await?;
@mvniekerk mvniekerk added the enhancement New feature or request label Aug 9, 2024
@mvniekerk
Copy link
Owner

Interesting feature suggestion! Thank you for reporting.

@JosiahParry
Copy link
Author

Of course! At present I've implemented this by removing the scheduled task and making a new one. It's a little bit roundabout but it works!

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

No branches or pull requests

2 participants