You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usually expressions like H/5 * * * * mean "Every 5 minutes starting at a random offset between 0 and 4 minutes", guaranteeing 12 runs per hour.1
This library on the other hand evaluates this to "Every 5 minutes starting at a random offset between 0 and 59 minutes". Depending on the hashSeed this can be between 12 or even just 1 time per hour.
As this is in my opinion unexpected and I can't think of any real usecases for this, I would consider this a bug.
If for any reason this behavior is kept, this library should support hash ranges, so H(0-4)/5 * * * * could be used instead.2
Note that jenkins also evaluates this differently, taken from the documentation: H(0-29)/10 * * * *: every ten minutes in the first half of every hour (three times, perhaps at :04, :14, :24) ↩
The text was updated successfully, but these errors were encountered:
Thanks for explaining this clearly and pointing out the core of the missing functionality. Without support for steps and ranges, it's indeed missing half of its functionality, and also current behavior isn't expected. I'll add it to my backlog and look into it as soon as I can.
Uh oh!
There was an error while loading. Please reload this page.
Usually expressions like
H/5 * * * *
mean "Every 5 minutes starting at a random offset between 0 and 4 minutes", guaranteeing 12 runs per hour.1This library on the other hand evaluates this to "Every 5 minutes starting at a random offset between 0 and 59 minutes". Depending on the
hashSeed
this can be between 12 or even just 1 time per hour.As this is in my opinion unexpected and I can't think of any real usecases for this, I would consider this a bug.
If for any reason this behavior is kept, this library should support hash ranges, so
H(0-4)/5 * * * *
could be used instead.2Footnotes
For example in jenkins, which the PR Adding support for the H syntax, allowing to add jitter to a cron expression #377 was based on: https://www.jenkins.io/doc/book/pipeline/syntax/#cron-syntax ↩
Note that jenkins also evaluates this differently, taken from the documentation:
H(0-29)/10 * * * *
: every ten minutes in the first half of every hour (three times, perhaps at :04, :14, :24) ↩The text was updated successfully, but these errors were encountered: