NutzCN Logo
问答 quartz 定时任务走了两次
发布于 38天前 作者 啊哈 200 次浏览 复制 上一个帖子 下一个帖子
标签:
2024-03-06 17:12:51:[DEBUG][ org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:291)] [org.quartz.core.QuartzSchedulerThread]:batch acquisition of 1 triggers
2024-03-06 17:12:54:[DEBUG][ org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:291)] [org.quartz.core.QuartzSchedulerThread]:batch acquisition of 1 triggers
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165)] [org.nutz.ioc.impl.NutIoc]:Get 'quartzDay_CL'<class bxa.quartz.QuartzDay_CL>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:191)] [org.nutz.ioc.impl.NutIoc]:	 >> Load definition name=quartzDay_CL
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165)] [org.nutz.ioc.impl.NutIoc]:Get 'quartzDay_CL'<class bxa.quartz.QuartzDay_CL>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:191)] [org.nutz.ioc.impl.NutIoc]:	 >> Load definition name=quartzDay_CL
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226)] [org.nutz.ioc.loader.combo.ComboIocLoader]:Found IocObject(quartzDay_CL) in AnnotationIocLoader(packages=[bxa])
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:222)] [org.nutz.ioc.impl.NutIoc]:	 >> Make...'quartzDay_CL'<class bxa.quartz.QuartzDay_CL>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226)] [org.nutz.ioc.loader.combo.ComboIocLoader]:Found IocObject(quartzDay_CL) in AnnotationIocLoader(packages=[bxa])
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:222)] [org.nutz.ioc.impl.NutIoc]:	 >> Make...'quartzDay_CL'<class bxa.quartz.QuartzDay_CL>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64)] [org.nutz.ioc.impl.ScopeContext]:Save object 'quartzDay_CL' to [app] 
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64)] [org.nutz.ioc.impl.ScopeContext]:Save object 'quartzDay_CL' to [app] 
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76)] [org.nutz.ioc.aop.impl.DefaultMirrorFactory]:Load class bxa.quartz.QuartzDay_CL without AOP
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76)] [org.nutz.ioc.aop.impl.DefaultMirrorFactory]:Load class bxa.quartz.QuartzDay_CL without AOP
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165)] [org.nutz.ioc.impl.NutIoc]:Get 'conf'<class org.nutz.ioc.impl.PropertiesProxy>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165)] [org.nutz.ioc.impl.NutIoc]:Get 'conf'<class org.nutz.ioc.impl.PropertiesProxy>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165)] [org.nutz.ioc.impl.NutIoc]:Get 'chanliangJob'<class bxa.quartz.job.ChanliangJob>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:191)] [org.nutz.ioc.impl.NutIoc]:	 >> Load definition name=chanliangJob
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226)] [org.nutz.ioc.loader.combo.ComboIocLoader]:Found IocObject(chanliangJob) in AnnotationIocLoader(packages=[bxa])
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:222)] [org.nutz.ioc.impl.NutIoc]:	 >> Make...'chanliangJob'<class bxa.quartz.job.ChanliangJob>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64)] [org.nutz.ioc.impl.ScopeContext]:Save object 'chanliangJob' to [app] 
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76)] [org.nutz.ioc.aop.impl.DefaultMirrorFactory]:Load class bxa.quartz.job.ChanliangJob without AOP
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165)] [org.nutz.ioc.impl.NutIoc]:Get 'chanliangJob'<class bxa.quartz.job.ChanliangJob>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:191)] [org.nutz.ioc.impl.NutIoc]:	 >> Load definition name=chanliangJob
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226)] [org.nutz.ioc.loader.combo.ComboIocLoader]:Found IocObject(chanliangJob) in AnnotationIocLoader(packages=[bxa])
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:222)] [org.nutz.ioc.impl.NutIoc]:	 >> Make...'chanliangJob'<class bxa.quartz.job.ChanliangJob>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64)] [org.nutz.ioc.impl.ScopeContext]:Save object 'chanliangJob' to [app] 
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76)] [org.nutz.ioc.aop.impl.DefaultMirrorFactory]:Load class bxa.quartz.job.ChanliangJob without AOP
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165)] [org.nutz.ioc.impl.NutIoc]:Get 'chanliangDao'<class bxa.quartz.job.ChanLiangDao>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:191)] [org.nutz.ioc.impl.NutIoc]:	 >> Load definition name=chanliangDao
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226)] [org.nutz.ioc.loader.combo.ComboIocLoader]:Found IocObject(chanliangDao) in AnnotationIocLoader(packages=[bxa])
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:222)] [org.nutz.ioc.impl.NutIoc]:	 >> Make...'chanliangDao'<class bxa.quartz.job.ChanLiangDao>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64)] [org.nutz.ioc.impl.ScopeContext]:Save object 'chanliangDao' to [app] 
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165)] [org.nutz.ioc.impl.NutIoc]:Get 'chanliangDao'<class bxa.quartz.job.ChanLiangDao>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76)] [org.nutz.ioc.aop.impl.DefaultMirrorFactory]:Load class bxa.quartz.job.ChanLiangDao without AOP
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:191)] [org.nutz.ioc.impl.NutIoc]:	 >> Load definition name=chanliangDao
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226)] [org.nutz.ioc.loader.combo.ComboIocLoader]:Found IocObject(chanliangDao) in AnnotationIocLoader(packages=[bxa])
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:222)] [org.nutz.ioc.impl.NutIoc]:	 >> Make...'chanliangDao'<class bxa.quartz.job.ChanLiangDao>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64)] [org.nutz.ioc.impl.ScopeContext]:Save object 'chanliangDao' to [app] 
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76)] [org.nutz.ioc.aop.impl.DefaultMirrorFactory]:Load class bxa.quartz.job.ChanLiangDao without AOP
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165)] [org.nutz.ioc.impl.NutIoc]:Get 'dao'<class bxa.common.Dao>
2024-03-06 17:13:00:[DEBUG][ org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165)] [org.nutz.ioc.impl.NutIoc]:Get 'dao'<class bxa.common.Dao>
2024-03-06 17:13:00:[DEBUG][ org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:291)] [org.quartz.core.QuartzSchedulerThread]:batch acquisition of 0 triggers
2024-03-06 17:13:00:[DEBUG][ org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:291)] [org.quartz.core.QuartzSchedulerThread]:batch acquisition of 0 triggers
2024-03-06 17:13:00:[DEBUG][ org.quartz.core.JobRunShell.run(JobRunShell.java:201)] [org.quartz.core.JobRunShell]:Calling execute on job DEFAULT.bxa.quartz.QuartzDay_CL
t
1 回复

``` @IocBean @Scheduled(cron = "0 13 17 * * ?") // 直接使用注解来声明cron 从左到右分别是 秒 分 时 日 月 星期 年 public class QuartzDay_CL implements Job { @Inject PropertiesProxy conf; @Inject ChanliangJob chanliangJob; public void execute(JobExecutionContext context) throws JobExecutionException { System.out.println("tttttttttttt"); String lastDate =DateUtil.getLastDate("yyyy-MM-dd"); chanliangJob.execute(1,lastDate);//日统计 } }

```

添加回复
请先登陆
回到顶部