我用的nutzwk框架,执行的后台任务总是被执行两次,也没搞明白哪里的原因。
@IocBean
public class UpdateAnnualJob implements Job {
private static final Log log = Logs.get();
@Inject
protected Dao dao;
public void execute(JobExecutionContext context) throws JobExecutionException {
try {
JobDataMap data = context.getJobDetail().getJobDataMap();
String taskId = context.getJobDetail().getKey().getName();
......
......
业务逻辑
......
}
}
2020-01-02 23:58:00,005 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'updateAnnualJob'<class cn.wizzer.app.web.commons.quartz.job.UpdateAnnualJob>
2020-01-02 23:58:00,005 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'updateAnnualJob'<class cn.wizzer.app.web.commons.quartz.job.UpdateAnnualJob>
2020-01-02 23:58:00,005 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=updateAnnualJob
2020-01-02 23:58:00,005 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=updateAnnualJob
2020-01-02 23:58:00,005 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:169) DEBUG - Found IocObject(updateAnnualJob) in AnnotationIocLoader(packages=[cn.wizzer])
2020-01-02 23:58:00,005 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:169) DEBUG - Found IocObject(updateAnnualJob) in AnnotationIocLoader(packages=[cn.wizzer])
2020-01-02 23:58:00,005 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'updateAnnualJob'<class cn.wizzer.app.web.commons.quartz.job.UpdateAnnualJob>
2020-01-02 23:58:00,005 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'updateAnnualJob'<class cn.wizzer.app.web.commons.quartz.job.UpdateAnnualJob>
2020-01-02 23:58:00,005 cn.wizzer.app.web.commons.plugin.PluginAopConfigure.getInterceptorPairList(PluginAopConfigure.java:33) DEBUG - skip -- cn.wizzer.app.web.commons.quartz.job.UpdateAnnualJob
2020-01-02 23:58:00,005 cn.wizzer.app.web.commons.plugin.PluginAopConfigure.getInterceptorPairList(PluginAopConfigure.java:33) DEBUG - skip -- cn.wizzer.app.web.commons.quartz.job.UpdateAnnualJob
2020-01-02 23:58:00,005 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class cn.wizzer.app.web.commons.quartz.job.UpdateAnnualJob without AOP
2020-01-02 23:58:00,005 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class cn.wizzer.app.web.commons.quartz.job.UpdateAnnualJob without AOP
2020-01-02 23:58:00,021 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'updateAnnualJob' to [app]
2020-01-02 23:58:00,021 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'updateAnnualJob' to [app]
2020-01-02 23:58:00,021 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2020-01-02 23:58:00,021 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2020-01-02 23:58:00,021 org.quartz.core.JobRunShell.run(JobRunShell.java:201) DEBUG - Calling execute on job e0b4be177c584c528a378cb881a3457d.e0b4be177c584c528a378cb881a3457d
2020-01-02 23:58:00,021 org.quartz.core.JobRunShell.run(JobRunShell.java:201) DEBUG - Calling execute on job e0b4be177c584c528a378cb881a3457d.e0b4be177c584c528a378cb881a3457d