我开发了一个作业,我想每 5 分钟运行一次,但在某些情况下,作业完成时间可能会超过 5 分钟.
I have developed a job which I want to run say after every 5 mins, but there may be certain circumstances where the job completion time may exceeds 5 mins.
我正在使用石英调度程序使用 cron 表达式来安排我的工作.有什么办法可以告诉quartz scheduler 等待下一个作业运行,直到第一个作业完成?
I am using quartz scheduler to schedule my job using a cron expression. Is there any way to tell quartz scheduler to hold the next run of job untill first one is completed?
我正在寻找类似于 -
private static final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1); executor.scheduledWithFixedDelay(..); 推荐答案使用 有状态作业.来自文档:
不允许有状态的作业并发执行,这意味着新的触发之前发生的execute(xx) 方法完成会延迟.
stateful jobs are not allowed to execute concurrently, which means new triggers that occur before the completion of the execute(xx) method will be delayed.
更多推荐
在石英调度程序中以固定延迟进行调度?
发布评论