从瘦身到独角兽。Unicorn 在我的开发机器(Mac OSX)上运行良好,但在 Heroku 上失败,并一遍又一遍地显示以下消息(不同的 PID,0 到 2 之间的不同工人编号)reaped #<Process::Status: pid 564 exit 1> worker=0
。日志中没有其他消息表明问题所在。此消息表示什么以及如何对其进行故障排除?
Procfile:
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
Unicorn.rb:
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end
after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to sent QUIT'
end
defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end