tokio-cron-scheduler icon indicating copy to clipboard operation
tokio-cron-scheduler copied to clipboard

[Feature] Add method to change schedule

Open JosiahParry opened this issue 7 months ago • 2 comments

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?;

JosiahParry avatar Jul 28 '24 20:07 JosiahParry