instance method
clear_active_connections!
Ruby on Rails 8.0.4
Since v2.2.3Signature
clear_active_connections!(role = nil)
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.
Parameters
-
roleopt = nil
Source
# File activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb, line 164
def clear_active_connections!(role = nil)
each_connection_pool(role).each do |pool|
pool.release_connection
pool.disable_query_cache!
end
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb line 164
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::ConnectionHandler