9 lines
290 B
Plaintext
9 lines
290 B
Plaintext
after_fork do |server, worker|
|
|
# Start up the database connection again in the worker
|
|
if defined?(ActiveRecord::Base)
|
|
ActiveRecord::Base.establish_connection
|
|
end
|
|
child_pid = server.config[:pid].sub(".pid", ".#{worker.nr}.pid")
|
|
system("echo #{Process.pid} > #{child_pid}")
|
|
end
|