Comments (12)
My scheduler.yml
file
DailyCheckWorker:
cron: "0 20 00 * * *"
class: DailyCheckWorker
queue: worker
description: "abcdef"
Then in my sidekiq.rb
file
Sidekiq.configure_server do |config|
config.redis = { size: 126 }
config.reliable_fetch!
config.reliable_scheduler!
puts File.expand_path("../../../config/scheduler.yml",__FILE__)
config.on(:startup) do
Sidekiq.schedule = YAML.load_file(File.expand_path("../../../config/scheduler.yml",__FILE__))
end
end
My worker is as follows
class DailyCheckWorker
include Sidekiq::Worker
sidekiq_options queue: :worker
def perform
logger.info 'I RAN'
end
end
I just noticed this when starting the server
19:03:36 worker.1 | 2016-02-29T19:03:36.323Z 14320 TID-ow9xey8l0 INFO: Loading Schedule
19:03:36 worker.1 | 2016-02-29T19:03:36.323Z 14320 TID-ow9xey8l0 INFO: Schedule empty! Set Sidekiq.schedule
19:03:36 worker.1 | 2016-02-29T19:03:36.323Z 14320 TID-ow9xey8l0 INFO: Schedules Loaded
I create my queues in a Procfile
web: bundle exec puma -C config/puma.rb
reports: bundle exec sidekiq -q reports
worker: bundle exec sidekiq -q worker
from sidekiq-scheduler.
any ideas?
from sidekiq-scheduler.
This will run at 00:00 on the 19th of every month. Is that what you want?
from sidekiq-scheduler.
With 6 options doesn't it mean the first is seconds second is minutes and third is hours? So my understanding was 00:00:19 every day every month every year?
from sidekiq-scheduler.
Yes, you are right. Could you add more info about your configuration and the way you load the scheduler?
Thanks
from sidekiq-scheduler.
The config startup should be like this:
config.on(:startup) do
Sidekiq.schedule = YAML.load_file(File.expand_path("../../../config/scheduler.yml",__FILE__))
Sidekiq::Scheduler.load_schedule! # This will retrigger the loading stage
end
But you can also avoid this if you add the :schedule: line to you sidekiq.yml like this
:schedule:
DailyCheckWorker:
cron: "0 20 00 * * *"
class: DailyCheckWorker
queue: worker
description: "abcdef"
from sidekiq-scheduler.
Okay, so it is working now. Thank you so much for the help!
but it seems to trigger the job on each queue I have.
On start up it says
20:10:03 reports.1 | 2016-02-29T20:10:03.209Z 18585 TID-owxpvmwow INFO: Scheduling DailyCheckWorker
20:10:03 worker.1 | 2016-02-29T20:10:03.209Z 18587 TID-ove3rirco INFO: Scheduling DailyCheckWorker
from sidekiq-scheduler.
Sorry you should use reload_schedule! instead of load_schedule!
from sidekiq-scheduler.
It still runs the job on each queue I have. Do I need to load different sidekiq configs into my queues? As each of them is actually a separate instance of sidekiq running? If I am not mistaken?
For example...
web: bundle exec puma -C config/puma.rb
reports: bundle exec sidekiq -q reports -C ./config/sidekiqconfig.rb
worker: bundle exec sidekiq -q worker -C ./config/differentsidekiqconfig.rb
from sidekiq-scheduler.
Sorry I didn't mean to close the issue.
I'm still having the issue of the job running on each queue. If I add more queues it runs more often.
from sidekiq-scheduler.
Is this related with this issue? Because I thought that this issue was related with the fact that the jobs was not running.
from sidekiq-scheduler.
Okay I will open a new issue that reflects the new problem
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 2
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.