scout_apm_ruby
scout_apm_ruby copied to clipboard
Fix deprecation warning in ActiveRecord 7.1 when clearing active connections
Hi. Passing no argument to ActiveRecord::Base.connection_handler.clear_active_connections!
was deprecated here and produces following log.
DEPRECATION WARNING: `clear_active_connections!` currently only applies to connection pools in the current role (`writing`). In Rails 7.2, this method will apply to all known pools, regardless of role. To affect only those connections belonging to a specific role, pass the role name as an argument. To switch to the new behavior, pass `:all` as the role name.
Rails documentation of method: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/ConnectionHandler.html#method-i-clear_active_connections-21