INNER CODE UNIT · Ruby
sig
cenit-io/cenit · config/unicorn.rb:45
sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
Process.kill(sig, File.read(old_pid).to_i)
rescue Errno::ENOENT, Errno::ESRCH
# someone else did our job for us
end
end
sleep 1
end
after_fork do |server, worker|
defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
defined?(Rails) and Rails.cache.respond_to?(:reconnect) and Rails.cache.reconnect
Cenit::Rabbit.init
puts "Initializing Unicorn #{worker.nr}"
if worker.nr.zero?