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
parent aa5805e8b0
commit a4e6662833

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