如何在Quartz调度程序中每25秒运行一次? [英] How to run every 25 seconds in Quartz scheduler?
本文介绍了如何在Quartz调度程序中每25秒运行一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Quartz Scheduling API for Java。你能帮助我运行每25秒使用cron表达式。这只是一个延迟。它不必总是在第二个0开始。例如,序列是这样的:0:00,0:25,0:50,1:15,1:40,2:05等,直到分钟5,当顺序从第二个0开始。
谢谢。
解决方案
我不认为cron表达式会允许你那么你可以使用
SimpleScheduleBuilder.repeatSecondlyForever(25)
pre>
为300(5分钟)是25的倍数,它会自动重复。
I am using the Quartz Scheduling API for Java. Could you help me to run every 25 seconds using cron-expression. It's just a delay. It does not have to start always at second 0. For example, the sequence is like this: 0:00, 0:25, 0:50, 1:15, 1:40, 2:05, etc until minute 5 when the sequence begins again at second 0. Thank you.
解决方案I don't think cron expression will allow you to do that, but you can use
SimpleScheduleBuilder.repeatSecondlyForever( 25 )
as 300 (5 minutes) is a multiple of 25 it will repeat automatically.
这篇关于如何在Quartz调度程序中每25秒运行一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文