c# - quartz.net automatic delete trigger -
i using quartz.net(2.2.x) in winform application(visual studio 2013),but when invoke function, program deletes trigger automatically.
the task execute once.
this log snip:
2015-05-12 15:19:01,056 [taskscheduler_quartzschedulerthread] debug quartz.core.quartzschedulerthread [(null)] - batch acquisition of 0 triggers 2015-05-12 15:19:01,141 [taskscheduler_worker-4] info probevideoupdate [(null)] - 开始调度检测视频更新作业..... 2015-05-12 15:19:01,275 [taskscheduler_worker-3] info netstatushelper [(null)] - ping www.baidu.com success 2015-05-12 15:19:01,529 [taskscheduler_worker-3] info netstatushelper [(null)] - 网络正常 2015-05-12 15:19:01,554 [taskscheduler_worker-4] info printapp [(null)] - original json address:http://api.zouwo.net/weixin/macdata?id=1001 2015-05-12 15:19:01,625 [taskscheduler_worker-3] debug quartz.core.jobrunshell [(null)] - trigger instruction : deletetrigger 2015-05-12 15:19:01,816 [taskscheduler_worker-3] debug quartz.simpl.ramjobstore [(null)] - deleting trigger 2015-05-12 15:19:01,912 [taskscheduler_worker-4] info netstatushelper [(null)] - isupdate:0 2015-05-12 15:19:02,099 [taskscheduler_worker-4] debug quartz.core.jobrunshell [(null)] - trigger instruction : deletetrigger 2015-05-12 15:19:02,195 [taskscheduler_worker-4] debug quartz.simpl.ramjobstore [(null)] - deleting trigger 2015-05-12 15:19:30,999 [taskscheduler_quartzschedulerthread] debug quartz.core.quartzschedulerthread [(null)] - batch acquisition of 0 triggers 2015-05-12 15:19:56,247 [taskscheduler_quartzschedulerthread] debug quartz.core.quartzschedulerthread [(null)] - batch acquisition of 0 triggers 2015-05-12 15:20:25,754 [taskscheduler_quartzschedulerthread] debug quartz.core.quartzschedulerthread [(null)] - batch acquisition of 0 triggers 2015-05-12 15:20:54,907 [taskscheduler_quartzschedulerthread] debug quartz.core.quartzschedulerthread [(null)] - batch acquisition of 0 triggers 2015-05-12 15:21:20,334 [taskscheduler_quartzschedulerthread] debug quartz.core.quartzschedulerthread [(null)] - batch acquisition of 0 triggers 2015-05-12 15:21:48,070 [taskscheduler_quartzschedulerthread] debug quartz.core.quartzschedulerthread [(null)] - batch acquisition of 0 triggers 2015-05-12 15:22:14,371 [taskscheduler_quartzschedulerthread] debug quartz.core.quartzschedulerthread [(null)] - batch acquisition of 0 triggers
this job configuration:
<job> <name>probevideoupdatejob</name> <group>group5</group> <description>侦测视频更新标识</description> <job-type>rrmall.wxprint.common.cmd.probevideoupdate,rrmall.wxprint.common</job-type> <durable>true</durable> <recover>true</recover> </job> <trigger> <!--cron复杂任务触发器使用cron表达式定制任务调度--> <cron> <name>probevideoupdatetrigger</name> <group>group6</group> <job-name>probevideoupdatejob</job-name> <job-group>group5</job-group> <start-time>2014-10-25t00:00:00+08:00</start-time> <cron-expression>0/3 * * * * ?</cron-expression> </cron> </trigger>
and function invoke job:
#region invokeprobevideoupdatejob public static void invokeprobevideoupdatejob() { datetimeoffset runtime = datebuilder.evenminutedate(datetimeoffset.utcnow); try { ijobdetail job = jobbuilder.create<probevideoupdate>() .withidentity("probevideoupdatejob", "group5") .build(); itrigger trigger = triggerbuilder.create() .withidentity("probevideoupdatetrigger", "group6") .startat(runtime) .build(); schedule.schedulejob(job, trigger); schedule.start(); } catch (exception e) { logger.error("侦测视频更新时时遇到错误", e); } } #endregion
make sure app.config don't have quartz node config.the quartz config should write app.config or quartz.config file,config both sides not permittd.
Comments
Post a Comment