Delete scheduled Quartz jobs before startup

PHOTO EMBED

Mon Jun 14 2021 07:21:03 GMT+0000 (Coordinated Universal Time)

Saved by @LavenPillay #quartz #java

Set<JobKey> jobKeys = scheduler.getJobKeys(GroupMatcher.anyJobGroup());

Iterator<JobKey> it = jobKeys.iterator();
while(it.hasNext()){
  System.out.println(it.next());

  JobKey key = it.next();
  scheduler.deleteJob(key);
}
content_copyCOPY

Cancelling a job which was durable and did not end