Simple integration between Sidekiq and Whenever gems. Based on Sidetiq's DSL.
Add this line to your application's Gemfile:
gem 'sidekiq-recurrence'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sidekiq-recurrence
You can run:
$ cd /apps/my-great-project
$ wheneverize-recurrence .
This will create or update the config/schedule.rb
file for you.
Or simply add this to your config/schedule.rb
file:
run_sidekiq_workers
require 'sidekiq/worker'
require 'sidekiq/recurrence'
class BasicWorker
include Sidekiq::Worker
include Sidekiq::Recurrence
recurrence 1.day
# OR
recurrence [1.day, :at => '4:30 am']
def perform
# do stuff ...
end
end
- Fork it ( http://github.com//sidekiq-recurrence/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request