我在群集中运行Quartz
,我确实定期运行作业。作业在一台机器上启动,其他机器将一直运行到下一个执行时间。
我现在想要的是如果先前的调用尚未完成,则延迟作业调用。例如:
10:00 - instance invocation#1
10:06 - invocation#1 finished
10:10 - instance invocation#2
10:13 - invocation#2 finished
10:20 - instance invocation#3
10:31 - invocation#3 finished // took longer than expected
10:31 - instance invocation#4 // start delayed
10:35 - invocation#4 finished
即使这样也是可以接受的:
10:00 - instance invocation#1
10:06 - invocation#1 finished
10:10 - instance invocation#2
10:13 - invocation#2 finished
10:20 - instance invocation#3
10:31 - invocation#3 finished // took longer than expected
10:40 - instance invocation#4 // waits for next timed invocation
10:44 - invocation#4 finished
我正在使用类似触发器的cron表达式,并且每10分钟触发一次(0 0/10 * * *
)。