Let Quartz interrupt jobs on shutdown.

Original commit: elastic/x-pack-elasticsearch@3084f9b3f4
This commit is contained in:
Martijn van Groningen 2014-11-20 11:56:48 +01:00
parent 79b10f8c0d
commit 0438e61404
1 changed files with 2 additions and 0 deletions

View File

@ -53,6 +53,8 @@ public class AlertScheduler extends AbstractComponent {
Properties properties = new Properties();
properties.setProperty("org.quartz.threadPool.class", AlertQuartzThreadPool.class.getName());
properties.setProperty(StdSchedulerFactory.PROP_SCHED_SKIP_UPDATE_CHECK, "true");
properties.setProperty(StdSchedulerFactory.PROP_SCHED_INTERRUPT_JOBS_ON_SHUTDOWN, "true");
properties.setProperty(StdSchedulerFactory.PROP_SCHED_INTERRUPT_JOBS_ON_SHUTDOWN_WITH_WAIT, "true");
SchedulerFactory schFactory = new StdSchedulerFactory(properties);
scheduler = schFactory.getScheduler();
scheduler.setJobFactory(new SimpleJobFactory());