Schedule daily jobs to run at a specific time using one global cron job. (In my case Heroku Scheduler)
Set up a cron job to run bundle exec rake sked:all
and it will
automatically find all jobs that should be run at the specific time.
Include the following in any class that you want to run.
include Sked::Worker
append_job({:time => 0, :type => :daily})
The rake task automatically schedules it using a background job. It will
work with both resque and Sidekiq, or any other library that responds to
a perform_async
method.
Add this line to your application's Gemfile:
gem 'sked'
And then execute:
$ bundle
Or install it yourself as:
$ gem install Sked
TODO: Write usage instructions here
- Fork it ( http://github.com/mikesilvis/sked/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