我开发了一个工作,我想每 5 分钟运行一次,但在某些情况下,工作完成时间可能会超过 5 分钟。
我正在使用 quartz scheduler 通过 cron 表达式来安排我的工作。有什么方法可以告诉 quartz 调度程序暂停下一次作业,直到第一个作业完成?
我正在寻找类似于 -
private static final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
executor.scheduledWithFixedDelay(..);
最佳答案
使用 StatefulJob .来自文档:
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.
关于java - 在 quartz 调度程序中以固定延迟安排?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5063482/