各位大侠帮我看看,谢谢!
举个例
我添加了一个任务,开始时间是2010年3月1日,结束时间是2010年5月1日,调度时间是在这段日期间每天上午10点钟调度
调度任务数据是保存在数据库中的,每当tomcat启动时都会去加载当天的任务放入调度列表中,当到每天10点再进行调度。
但当我2010年3月3日上午9点钟启动tomcat时,它就将我这个任务放入调度列表,而且进行了一次调度.当到达10点钟时又进行了一次调度
问题是当tomcat启动时,还没到10点钟它就进行了一次调度?
另一个例子
同上
我添加了一个任务,开始时间是2010年3月3日,结束时间是2010年4月1日,调度时间是在这段日期间每天上午10点钟调度,当我2010年3月3日中午12点钟启动tomcat时,它就将我这个任务放入调度列表,而且进行了一次调度。
问题是10点钟过了它还会进行一次调度。应该要到第二天的10点才调度的呀。当然如果我是3月3日9点钟启动tomcat,它就只将今天的任务放入调度列表,到了10点才会去调度。
这个问题我想是在tomcat启动时,它都会将所有任务列表上一次可以调度的进行调度一次。
怎么设置在tomcat启动时不会去调度上一次的,只有在下一次任务到达时才进行调度呢?
这个问题怎么解决。
我用的是spring+hibernate+struts2+quartz
quartz.properties 配置内容
#===============================================================
#Configure Main Scheduler Properties
#===============================================================
org.quartz.scheduler.instanceName = QuartzScheduler
org.quartz.scheduler.instanceId = AUTO
#===============================================================
#Configure ThreadPool
#===============================================================
org.quartz.threadPool.threadCount = 1
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
#===============================================================
#Configure JobStore
#===============================================================
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
org.quartz.jobStore.misfireThreshold = 60000
web.xml 配置内容
Quartz Initializer Servlet
QuartzInitializer
org.quartz.ee.servlet.QuartzInitializerServlet
config-file
/quartz.properties
shutdown-on-unload
true
start-scheduler-on-load
true
5