mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 13:18:33 +08:00
25 lines
447 B
Ruby
25 lines
447 B
Ruby
require "demon/base"
|
|
|
|
class Demon::Sidekiq < Demon::Base
|
|
|
|
def self.prefix
|
|
"sidekiq"
|
|
end
|
|
|
|
private
|
|
|
|
def after_fork
|
|
require 'sidekiq/cli'
|
|
# 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
|
|
|
|
end
|