后台没报错,只有项目启动的时候执行一次,之后就没有执行了,定的是10秒执行一次
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler sched = null;
Date ft = null;
try {
sched = sf.getScheduler();
JobDetail job = JobBuilder.newJob(LoginOutJob.class).withIdentity("logout", "logoutGroup").build();
CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity("logoutTrigger", "logoutGroup")
.withSchedule(CronScheduleBuilder.cronSchedule("0/10 * * * * ?")).build();
ft = sched.scheduleJob(job, trigger);
} catch (SchedulerException e) {
e.printStackTrace();
}