New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用固定速率,xxl-job宕机重启后,下次执行时间乱掉 #3432
Comments
默认是按重启时间和固定速率时间计算算下一次执行时间,如何考虑兼容考虑用崩溃前的最后一次执行时间和固定速率算出重启后的第一次执行时间。 |
问题描述:使用固定速率一小时,每隔一小时执行一次,比如第一次执行时间8:10,第二次执行时间9:10,然后在9:30的时候xxl-job重启,则该定时器的下一次执行时间会变为10:30; |
看这个需求,和现象。是需要在某个地方保存一下这个任务上一次执行的时间。 有两个问题:
|
cron表达式不支持考虑开始时间的周期执行。比如在未来的某个时间点开始第一次执行,然后按照固定周期循环执行。 |
若中间停的时间超过间隔一个小时,比如10:10执行时间已经错过,那重启后第一次执行时间就是11:10 |
执行周期的单位可能为分钟,从某个时间开始,按照固定周期往后推,符合时间点就执行,所以考虑到cron表达式不支持。 |
可以记录一下上次执行成功的时间。 |
Please answer some questions before submitting your issue. Thanks!
Which version of XXL-JOB do you using?
Expected behavior
Actual behavior
Steps to reproduce the behavior
Other information
The text was updated successfully, but these errors were encountered: