instance method
clear_active_connections!
Ruby on Rails 7.0.10
Since v2.2.3Signature
clear_active_connections!(role = ActiveRecord::Base.current_role)
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 = ActiveRecord::Base.current_role
Source
# File activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb, line 168
def clear_active_connections!(role = ActiveRecord::Base.current_role)
connection_pool_list(role).each(&:release_connection)
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb line 168
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::ConnectionHandler