jmettraux/rufus-scheduler

Calls to `cron` can fail if fugit `Cron#rough_frequency` returns 0

dsander opened this issue ยท 1 comments

Hi ๐Ÿ‘‹ !

In some cases fugit seems to fail to calculate the rough_frequency for some cronlines (floraison/fugit#36). If that happens and the scheduler frequency is greater than 1 second rufus-scheduler aborts with the following exception:

2: from /Users/dominik/code/ruby/rufus-scheduler/lib/rufus/scheduler.rb:227:in `cron'
1: from /Users/dominik/code/ruby/rufus-scheduler/lib/rufus/scheduler.rb:621:in `do_schedule'
/Users/dominik/code/ruby/rufus-scheduler/lib/rufus/scheduler/jobs.rb:667:in `check_frequency': job frequency (min ~0s) is higher than scheduler frequency (3s) (ArgumentError)

We at Huginn came across that issue because we are using a "bi-daily" cronline ('0 0 */2 * *') and a user is using a scheduler frequency of 3. The work around for the particular user is easy (reduce the frequency), but we as a project we can't upgrade to rufus-scheduler > 3.5.0 because we are exposing the frequency as a setting users can change.

Not is not urgent at all, we have been using an older version for a very long time without any issues.

Solved at the fugit level, fix included in fugit 1.3.4.

Many thanks!