rufus-scheduler gem 中的 EveryJob 和 IntervalJob 有什么区别?
What's difference between EveryJob and IntervalJob in rufus-scheduler gem?
我认为带有选项 overlap: false
的 EveryJob 是 IntervalJob。我说的对吗?
没有
来自文档:
Whereas "every" jobs are like "every 10 minutes, do this", interval jobs are like "do that, then wait for 10 minutes, then do that again, and so on"
关于overlap: false
:
Since, by default, jobs are triggered in their own new thread, job instances might overlap. For example, a job that takes 10 minutes and is scheduled every 7 minutes will have overlaps.
To prevent overlap, one can set :overlap => false. Such a job will not trigger if one of its instance is already running.
The :overlap option is considered after the :mutex option when the scheduler is reviewing jobs for triggering.
对于IntervalJob
,时间增量是在最后一个触发结束点和下一个触发开始点之间。
对于 EveryJob
,时间增量在触发开始点之间。
如果 EveryJob
有 overlap: false
,它不会在触发 "session" 仍在进行时触发。
https://github.com/jmettraux/rufus-scheduler#rufus-scheduler
我认为带有选项 overlap: false
的 EveryJob 是 IntervalJob。我说的对吗?
没有
来自文档:
Whereas "every" jobs are like "every 10 minutes, do this", interval jobs are like "do that, then wait for 10 minutes, then do that again, and so on"
关于overlap: false
:
Since, by default, jobs are triggered in their own new thread, job instances might overlap. For example, a job that takes 10 minutes and is scheduled every 7 minutes will have overlaps.
To prevent overlap, one can set :overlap => false. Such a job will not trigger if one of its instance is already running.
The :overlap option is considered after the :mutex option when the scheduler is reviewing jobs for triggering.
对于IntervalJob
,时间增量是在最后一个触发结束点和下一个触发开始点之间。
对于 EveryJob
,时间增量在触发开始点之间。
如果 EveryJob
有 overlap: false
,它不会在触发 "session" 仍在进行时触发。
https://github.com/jmettraux/rufus-scheduler#rufus-scheduler