FIX: Disconnects all connections in the pool before forking.

* We were leaking connections as a result. Connections opened
  before the fork were never closed.
This commit is contained in:
Guo Xiang Tan 2018-06-06 14:45:05 +08:00 committed by Neil Lalonde
parent db3f31a841
commit a74d62d618

View File

@ -210,7 +210,10 @@ before_fork do |server, worker|
end
ActiveRecord::Base.connection.disconnect!
RailsMultisite::ConnectionManagement.each_connection do
ActiveRecord::Base.connection_pool.disconnect!
end
$redis._client.disconnect
# Throttle the master from forking too quickly by sleeping. Due