Method: ActiveRecord::ConnectionAdapters::ConnectionHandler#clear_active_connections!

Defined in:
activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb

#clear_active_connections!(role = nil) ⇒ Object

Returns any connections in use by the current thread back to the pool, and also returns connections to the pool cached by threads that are no longer alive.



162
163
164
165
166
167
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb', line 162

def clear_active_connections!(role = nil)
  each_connection_pool(role).each do |pool|
    pool.release_connection
    pool.disable_query_cache!
  end
end