discourse/lib/demon/sidekiq.rb

34 lines
551 B
Ruby
Raw Normal View History

2013-11-01 18:57:50 -04:00
require "demon/base"
class Demon::Sidekiq < Demon::Base
2013-11-01 18:57:50 -04:00
def self.prefix
"sidekiq"
end
private
def suppress_stdout
false
end
def suppress_stderr
false
end
def after_fork
STDERR.puts "Loading Sidekiq in process id #{Process.pid}"
require 'sidekiq/cli'
2013-11-01 18:57:50 -04:00
cli = Sidekiq::CLI.instance
2014-05-13 20:21:11 -04:00
cli.parse(["-c", GlobalSetting.sidekiq_workers.to_s])
load Rails.root + "config/initializers/sidekiq.rb"
2013-11-01 18:57:50 -04:00
cli.run
rescue => e
STDERR.puts e.message
STDERR.puts e.backtrace.join("\n")
exit 1
end
2013-11-01 18:57:50 -04:00
end