Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unschedule all jobs using Quartz?

Today, I iterate

public void unschedule(final ScheduledEvent event) throws SchedulerException {
     ...
    scheduler.deleteJob(event.getName(), "my group");
     ...
}

If what i want is to unschedule all jobs, can this be done better (faster)?

like image 222
James Raitsev Avatar asked Apr 11 '13 21:04

James Raitsev


People also ask

How do you Unschedule a Quartz job?

2.2 Unschedule Job We can unschedule a Job by calling the unschedule() method of the Scheduler class and passing the TriggerKey . If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.

How do you schedule multiple jobs using Quartz?

If you want to schedule multiple jobs in your console application you can simply call Scheduler. ScheduleJob (IScheduler) passing the job and the trigger you've previously created: IJobDetail firstJob = JobBuilder.

How do I delete a job on Quartz?

Deleting a Job and Unscheduling All of Its Triggers // Schedule the job with the trigger scheduler. deleteJob(jobKey("job1", "group1"));

How does Quartz job scheduler work?

Quartz scheduler allows an enterprise to schedule a job at a specified date and time. It allows us to perform the operations to schedule or unschedule the jobs. It provides operations to start or stop or pause the scheduler. It also provides reminder services.


1 Answers

Scheduler#clear() will delete EVERYTHING, including triggers and calendars

If that's too severe, then I think your iterator is the only alternative

like image 71
Zim-Zam O'Pootertoot Avatar answered Sep 20 '22 01:09

Zim-Zam O'Pootertoot