Created
June 30, 2016 09:01
-
-
Save andruby/dc607d005d2ff760ebd38c8be285aa21 to your computer and use it in GitHub Desktop.
Sidekiq pusher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job_type :sidekiq, 'cd :path && bundle exec script/sidekiq_pusher.rb :worker :task' | |
every 1.hour do | |
sidekiq "job_name", worker: 'WorkerName' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# USAGE: ./sidekiq_pusher.rb WorkerName job | |
klass = ARGV[0] | |
task = ARGV[1] | |
require 'sidekiq' | |
# See config/initializers/sidekiq.rb | |
Sidekiq.configure_client do |config| | |
# Set namespace if needed | |
# config.redis = { namespace: "#{env_identifier}:sidekiq" } | |
end | |
Sidekiq::Client.push('class' => klass, 'args' => [task]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment