discourse/lib/demon/sidekiq.rb

25 lines
447 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 after_fork
require 'sidekiq/cli'
2013-11-01 18:57:50 -04: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
end
2013-11-01 18:57:50 -04:00
end