From 83f6e863b6f5cc3285e92bf9bf933236fa9df332 Mon Sep 17 00:00:00 2001 From: didil Date: Thu, 16 May 2013 22:03:37 +0100 Subject: [PATCH] fixes #928 example of using sidekiq with whenever without loading rails --- examples/scheduling.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/scheduling.rb b/examples/scheduling.rb index 27adba91..d25dfa6f 100644 --- a/examples/scheduling.rb +++ b/examples/scheduling.rb @@ -35,3 +35,13 @@ end every :hour do # Many shortcuts available: :hour, :day, :month, :year, :reboot runner "HourlyWorker.perform_async" 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 \ No newline at end of file