在石英调度程序中以固定延迟进行调度?
我开发了一项工作,我想每 5 分钟运行一次,但在某些情况下,工作完成时间可能会超过 5 分钟。
我正在使用quartz调度程序使用cron表达式来安排我的工作。有没有办法告诉石英调度程序保留下一次作业运行,直到第一个作业完成?
我正在寻找类似的东西 -
private static final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
executor.scheduledWithFixedDelay(..);
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.
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?
I am looking for something similar to -
private static final ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
executor.scheduledWithFixedDelay(..);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 StatefulJob。来自文档:
Use a StatefulJob. From the docs:
http://yongjun-jiao.blogspot.com/2010 /08/quartz-crontrigger-scdeuling-policy.html。
如果您使用 Spring 调度概念 http ://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/dynamic-language.html
http://yongjun-jiao.blogspot.com/2010/08/quartz-crontrigger-scdeuling-policy.html.
If you use spring scheduling concepts http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/dynamic-language.html