0

我已经使用cronSchedulerwith设置了一个触发器,misfireInstruction如下所示

     trigger = newTrigger().withIdentity("autoLockTrigger", "autoLockGroup").startNow()                 .withSchedule(cronSchedule(croneExpression).withMisfireHandlingInstructionFireAndProceed())
                    .forJob("autoLockJob","autoLockGroup")
                    .build();

我的quartz.properties 如下

org.quartz.scheduler.instanceName =MyScheduler


# Configuring ThreadPool
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 1
org.quartz.threadPool.threadPriority = 9

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.dataSource = myDS 
org.quartz.jobStore.tablePrefix = QRTZ_
#org.quartz.dataSource.myDS.jndiURL = jdbc/vikas


org.quartz.dataSource.myDS.driver = com.mysql.jdbc.Driver
org.quartz.dataSource.myDS.URL = jdbc:mysql://staging:3307/facao
org.quartz.dataSource.myDS.user = root
org.quartz.dataSource.myDS.password = toor
org.quartz.dataSource.myDS.maxConnections = 30


#org.quartz.jobStore.nonManagedTXDataSource = myDS
#to store data in string format (name-value pair)
org.quartz.jobStore.useProperties=true   

org.quartz.jobStore.misfireThreshold = 60000 

在我的代码中,如果我在特定时间设置了一些触发器并且服务器处于运行状态,那么调度程序运行正常,但是如果服务器在调度程序应该运行的时间内关闭,然后在一段时间后启动,那么调度程序应该运行失败的操作说明。但在我的情况下,失败的指令并没有一直运行它运行一段时间并不总是所以我的目的没有实现。请给出一些解决方案。先感谢您。

4

1 回答 1

0

我不确定 cron 触发器,但对于简单的触发器,是的,如果触发器的结束时间已经过去,那么一些提供的失火指令将不起作用。有关更多信息,请参阅javadoc片段。我想cron触发器也是如此。因此,这完全取决于您使用的 cron 表达式。

于 2013-06-06T06:18:29.970 回答