mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Merge pull request #930 from didil/master
fixes #928 example of using sidekiq with whenever without loading rails
This commit is contained in:
commit
3652cb8351
1 changed files with 10 additions and 0 deletions
|
@ -35,3 +35,13 @@ end
|
||||||
every :hour do # Many shortcuts available: :hour, :day, :month, :year, :reboot
|
every :hour do # Many shortcuts available: :hour, :day, :month, :year, :reboot
|
||||||
runner "HourlyWorker.perform_async"
|
runner "HourlyWorker.perform_async"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Using the runner command loads an extra rails instance
|
||||||
|
# If you want to avoid this you can use the sidekiq-client-cli gem which is a commmand line sidekiq client
|
||||||
|
# Define a new job_type
|
||||||
|
job_type :sidekiq, "cd :path && RAILS_ENV=:environment bundle exec sidekiq-client :task :output"
|
||||||
|
|
||||||
|
# Add the worker to the queue directly
|
||||||
|
every :hour do
|
||||||
|
sidekiq "push HourlyWorker"
|
||||||
|
end
|
Loading…
Reference in a new issue