Reconnect ActiveRecord when forking in Unicorn
This commit is contained in:
parent
0d48a34039
commit
a7b35aaf98
|
@ -80,6 +80,11 @@ define :unicorn_service, :rails_app => nil, :user => nil do
|
|||
rescue Errno::ENOENT, Errno::ESRCH
|
||||
end
|
||||
end
|
||||
|
||||
ActiveRecord::Base.connection.disconnect! if defined?(ActiveRecord::Base)
|
||||
EOS
|
||||
after_fork <<-'EOS'
|
||||
ActiveRecord::Base.establish_connection if defined?(ActiveRecord::Base)
|
||||
EOS
|
||||
owner "root"
|
||||
group "root"
|
||||
|
|
Loading…
Reference in New Issue