Removing Scheduled Tasks

I have configured a recurring command

                jobs.RecurringCommand<StartWeeklyHireInvoicesCommand>(new Schedule("0 3 * * *"),
                    new StartWeeklyHireInvoices
                    {
                        Date = DateOnly.FromDateTime(DateTime.UtcNow).AddDays(4)
                    }); // run daily at 3

I want to disable/remove this scheduled task, do I simply delete the code above?
I have tried the above but in the admin section the command is still listed in on the admin screen

How can I confirm the job is not going to run?

Thanks

Removing the code would prevent it from being re-created on Startup. You’ll also need to call IBackgroundJobs.DeleteRecurringTask() to remove the existing entry from the App and DB.

1 Like