1.日志:
2017-02-17 23:24:00,001 INFO C******Scheduler_Worker-1 - Timer JOB: 定时任务【开始】!
2017-02-17 23:24:00,001 INFO C******Scheduler_Worker-1 - Timer JOB: 定时任务【开始】!
2017-02-17 23:24:00,004 INFO C******Scheduler_Worker-1 - Timer JOB: 考勤提醒
2017-02-17 23:24:00,005 INFO C******Scheduler_Worker-1 - Timer JOB: 考勤提醒
2.配置文件 quartz.properties
org.quartz.scheduler.instanceName = C******Scheduler
org.quartz.threadPool.threadCount = 1
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true
已经设置为单线程执行了
3.MainSetup中,已加入关闭定时任务代码:
@Override
public void destroy(NutConfig conf) {
// 解决quartz有时候无法停止的问题
try {
conf.getIoc().get(Scheduler.class).shutdown(true);
} catch (Exception e) {
}
}
只开始了一个tomcat.