Skip to content

Commit

Permalink
Unban every 27 h/* */27 * * * gh-86 gh-103
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Apr 19, 2024
1 parent 6633c25 commit 9ea95f5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## fugit 1.11.0 not yet released

* Revert gh-86 ban on `every 27 hours` / `* */27 * * *` for gh-103


## fugit 1.10.1 released 2024-02-29

Expand Down
5 changes: 4 additions & 1 deletion lib/fugit/cron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,10 @@ def expand(min, max, r)

sta, edn, sla = r

return false if sla && sla > max
#return false if sla && sla > max
#
# let it go, "* */24 * * *" and "* */27 * * *" are okay
# gh-86 and gh-103

edn = max if sla && edn.nil?

Expand Down
12 changes: 11 additions & 1 deletion spec/cron_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,12 @@ class Fugit::Cron::TimeCursor
[ '10,,20 * 1,,11,,21, * *', '10,20 * 1,11,21 * *' ],
[ ',,10,,22, * * * * Asia/Omsk', '10,22 * * * * Asia/Omsk' ],

[ '* */27 * * *', '* 0 * * *' ],
[ '* */24 * * *', '* 0 * * *' ],
[ '* */23 * * *', '* 0,23 * * *' ],
#
# gh-86 and gh-103, it's dumb but still valid...

].each { |c, e|

it "parses #{c}" do
Expand Down Expand Up @@ -1371,9 +1377,13 @@ class Fugit::Cron::TimeCursor
'* * * 00 *', #

#'* */17 * * *',
'* */27 * * *',
#'* */27 * * *',
#
# gh-86
#'* */24 * * *',
#'* */23 * * *',
#
# gh-103

].each do |cron|

Expand Down
18 changes: 14 additions & 4 deletions spec/nat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,11 @@
'nada',
'every 2 years',
'every 2 weeks',
#'every 17 hours', # by default/strict:false --> "0 */17 * * *"
'every 27 hours',

#'every 17 hours',
# by default/strict:false --> "0 */17 * * *"
#'every 27 hours',
# by default/strict:false --> "0 */27 * * *"

].each do |input|

Expand All @@ -316,6 +319,10 @@

'every 17 hours',

'every 27 hours',
'every 2 years',
'every 2 weeks',

].each do |input|

it "rejects (returns nil) for #{input.inspect}" do
Expand Down Expand Up @@ -347,8 +354,11 @@
'nada',
'every 2 years',
'every 2 weeks',
#'every 17 hours', # by default/strict:false --> "0 */17 * * *"
'every 27 hours',

#'every 17 hours',
# by default/strict:false --> "0 */17 * * *"
#'every 27 hours',
# by default/strict:false --> "0 */27 * * *"

].each do |input|

Expand Down

0 comments on commit 9ea95f5

Please sign in to comment.