Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programatically delete jobs and associated triggers in Quartz.NET

I need a way to allow administrators to delete a job in Quartz.NET. Are there any built in methods for the JobDetail class that allow me delete the job and all associated triggers?

like image 921
Chris Avatar asked Oct 22 '10 10:10

Chris


2 Answers

you have to delete the job via the scheduler.

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

sched.DeleteJob(JobName, JobGroup);
like image 74
Paul U Avatar answered Nov 15 '22 04:11

Paul U


As of Today the DeleteJob method need to input JobKey as following.

scheduler.DeleteJob(new JobKey("JobName1", "JobGroup1"));
like image 41
Eric F. Avatar answered Nov 15 '22 04:11

Eric F.