2013-11-01 17:57:50 -05:00
|
|
|
require "demon/base"
|
2013-10-09 21:33:52 -05:00
|
|
|
|
|
|
|
class Demon::Sidekiq < Demon::Base
|
2013-11-01 17:57:50 -05:00
|
|
|
|
2013-10-09 21:33:52 -05:00
|
|
|
def self.prefix
|
|
|
|
"sidekiq"
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def after_fork
|
|
|
|
require 'sidekiq/cli'
|
2013-11-01 17:57:50 -05:00
|
|
|
# Reload initializer cause it needs to run after sidekiq/cli was required
|
|
|
|
load Rails.root + "config/initializers/sidekiq.rb"
|
|
|
|
cli = Sidekiq::CLI.instance
|
|
|
|
cli.parse([])
|
|
|
|
cli.run
|
|
|
|
rescue => e
|
|
|
|
STDERR.puts e.message
|
|
|
|
STDERR.puts e.backtrace.join("\n")
|
|
|
|
exit 1
|
2013-10-09 21:33:52 -05:00
|
|
|
end
|
2013-11-01 17:57:50 -05:00
|
|
|
|
2013-10-09 21:33:52 -05:00
|
|
|
end
|