Programmatically delete jobs and related triggers in Quartz.NET

I need administrators to be able to delete a job in Quartz.NET. Are there any built-in methods of the JobDetail class that allow me to delete a job and all triggers associated with it?

+3
source share
2 answers

you need to delete the task through the scheduler.

// First we must get a reference to a scheduler
ISchedulerFactory sf = new StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();

sched.DeleteJob(JobName, JobGroup);
+6
source

To date, the DeleteJob method needs to enter JobKey as follows.

scheduler.DeleteJob(new JobKey("JobName1", "JobGroup1"));
+1
source

Source: https://habr.com/ru/post/1770898/


All Articles