Skip to content
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

Documentation shows six * and it should be five #414

Open
zayter opened this issue Dec 7, 2022 · 3 comments
Open

Documentation shows six * and it should be five #414

zayter opened this issue Dec 7, 2022 · 3 comments

Comments

@zayter
Copy link

zayter commented Dec 7, 2022

image

right now it follows this way https://crontab.guru/ but documentation is different

Tested on Rails 6+

@palexvs
Copy link

palexvs commented Dec 13, 2022

I guess it should be 6 *:

  1. seconds
  2. minutes
  3. hours
  4. day
  5. month
  6. day week

regular crontab (5 *) + 1 * for seconds

@jonatasrancan
Copy link

You can use fugit gem to test the notations, it's used behind the scenes by rufus

[1] pry(main)> Fugit.parse('0 * * * * *')
=> #<Fugit::Cron:0x0000000139d6de38 @cron_s=nil, @hours=nil, @minutes=nil, @monthdays=nil, @months=nil, @original="0 * * * * *", @seconds=[0], @timezone=nil, @weekdays=nil, @zone=nil>

@unavailabl3
Copy link

For my case it was confirmed, that 5 symbols should be used for cron expressions in sidekiq.yml.
We needed to perform job every Monday at 12:00

  1. According to documentation (6 symbols):
Fugit.parse('0 12 * * 1 *')
=> #<Fugit::Cron:0x00000001100139c8
 @cron_s=nil,
 @day_and=nil,
 @hours=nil, # wrong
 @minutes=[12],
 @monthdays=nil,
 @months=[1],
 @original="0 12 * * 1 *",
 @seconds=[0],
 @timezone=nil,
 @weekdays=nil,
 @zone=nil>
  1. Pattern with 5 symbols (correct):
Fugit.parse('0 12 * * 1')
=> #<Fugit::Cron:0x0000000115e9f780
 @cron_s=nil,
 @day_and=nil,
 @hours=[12],
 @minutes=[0],
 @monthdays=nil,
 @months=nil,
 @original="0 12 * * 1",
 @seconds=[0],
 @timezone=nil,
 @weekdays=[[1]],
 @zone=nil>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants