lib/postgres/vacuum/jobs/monitor_job.rb in postgres-vacuum-monitor-0.14.1 vs lib/postgres/vacuum/jobs/monitor_job.rb in postgres-vacuum-monitor-0.15.0
- old
+ new
@@ -87,14 +87,10 @@
end
def with_each_db_name_and_connection
databases = Set.new
ActiveRecord::Base.connection_handler.connection_pools.map do |connection_pool|
- db_name = if Postgres::Vacuum::Compatibility.pre_rails_6_1?
- connection_pool.spec.config[:database]
- else
- connection_pool.db_config.configuration_hash[:database]
- end
+ db_name = connection_pool.db_config.configuration_hash[:database]
# activerecord allocates a connection pool per call to establish_connection
# multiple pools might interact with the same database so we use the
# database name to dedup
connection_pool.with_connection { |conn| yield(db_name, conn) } if databases.add?(db_name)