Disconnect the pool during failover and fallback.

This commit is contained in:
Guo Xiang Tan 2018-06-12 10:57:29 +08:00
parent 4ce1d230c7
commit fd75e54793
2 changed files with 1 additions and 3 deletions

View File

@ -98,8 +98,7 @@ class PostgreSQLFallbackHandler
end
def clear_connections
ActiveRecord::Base.clear_active_connections!
ActiveRecord::Base.clear_all_connections!
ActiveRecord::Base.connection_pool.disconnect
end
private

View File

@ -27,7 +27,6 @@ describe ActiveRecord::ConnectionHandling do
let(:postgresql_fallback_handler) { PostgreSQLFallbackHandler.instance }
before do
skip("Figure out why this test leaks connections")
postgresql_fallback_handler.initialized = true
['default', multisite_db].each do |db|