class ActiveRecord::ConnectionAdapters::ConnectionPool
def clear_reloadable_connections(raise_on_acquisition_timeout = true)
connections in the pool within a timeout interval (default duration is
- ActiveRecord::ExclusiveConnectionTimeoutError if unable to gain ownership of all
Raises:
require reloading.
Clears the cache which maps classes and re-connects connections that
def clear_reloadable_connections(raise_on_acquisition_timeout = true) with_exclusively_acquired_all_connections(raise_on_acquisition_timeout) do synchronize do @connections.each do |conn| if conn.in_use? conn.steal! checkin conn end conn.disconnect! if conn.requires_reloading? end @connections.delete_if(&:requires_reloading?) @available.clear end end end