Comments (5)
I guess it should be 6 *:
- seconds
- minutes
- hours
- day
- month
- day week
regular crontab (5 *) + 1 * for seconds
from sidekiq-scheduler.
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>
from sidekiq-scheduler.
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
- 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>
- 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>
from sidekiq-scheduler.
@unavailabl3 in practice both work but each behaves in a different way, as @palexvs said, if you provide six arguments, this is what it will expect
- seconds
- minutes
- hours
- day
- month
- day week
if you provide five, then this is what it will expect
- minute
- hours
- day
- monh
- day week
see documentation of fugit, please https://github.com/floraison/fugit?tab=readme-ov-file#the-second-extension
in your example, with 6 symbols @unavailabl3 , it should be
Fugit.parse('0 0 12 * * 1')
or 👇 if seconds don't matter
Fugit.parse('* 0 12 * * 1')
Some examples in the readme are wrong, though (i.e. saying "runs once per minute" where the example will run it once per second), so I am fixing that! Well maybe not, maybe I am just dumb 🤦
from sidekiq-scheduler.
Mention about the support of 6 arguments added to the readme 58e1835
from sidekiq-scheduler.
Related Issues (20)
- Did sidekiq-scheduler 5.0.0 add a Rails dependency? HOT 3
- Raises an exception when rufus_scheduler_options is nil by default HOT 3
- Could not find gem 'sidekiq-scheduler (= 5.0.1)' with platform 'arm64-darwin-21' HOT 1
- Sidekiq version requirement HOT 1
- Run job multiple times, but never at the same time HOT 3
- Uppercase character in header name: Cache-Control
- Sidekiq 7.1 warns when deprecated Redis commands are used
- Cron expression with day of month does not work HOT 4
- Support for Ruby 3.0 and deconstruct Hashes as keyword arguments. HOT 5
- Move away from deprecated Redis commands HOT 2
- undefined method `next_time' for nil:NilClass HOT 5
- re-use Sidekiq Rack::Static instance for assets
- RedisManager does not appear to be updating in test env HOT 6
- Sidekick (docker) deprecation warning HOT 1
- UI not loading on heroku HOT 7
- Error handler threw an error HOT 2
- [feature request] environment specific schedules HOT 1
- Recommend Sidekiq::Job instead of Sidekiq::Worker HOT 1
- How to test that sidekiq.yml is *correct*? HOT 3
- SidekiqScheduler::Manager enormous inspect output HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sidekiq-scheduler.