Skip to content

Latest commit

 

History

History
78 lines (56 loc) · 1.41 KB

README.md

File metadata and controls

78 lines (56 loc) · 1.41 KB

Sidekiq::Cron::Tasks

Build Status

Adds rake and cap tasks for loading Sidekiq::Cron::Jobs from a config file.

Usage

Rake task

You can run the rake task via:

bundle exec rake sidekiq_cron:load

It expects a configuration file at config/sidekiq_cron.yml in this format:

default: &defaults
  rake task does stuff:
    cron: "42 0 * * *"
    class: "RakeTaskJob"
    args:
      - does:stuff

development:
  <<: *defaults

staging:
  <<: *defaults

production:
  <<: *defaults

You can configure the location of this file, as well as name prefixes for tasks:

Sidekiq::Cron::Tasks.configure do |config|
  config.file = "/custom/file/path"
  config.prefix = "notmyprefix"
end

Capistrano

You can enable this task for Capistrano deployment. It runs around the same time that Rails' db migrations do. To enable it:

# Capfile
require 'capistrano/sidekiq-cron'

Installation

Add this line to your application's Gemfile:

gem 'sidekiq-cron-tasks'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sidekiq-cron-tasks

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.