mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:34:31 +08:00
FIX: pool drainer to use Rails 5.2 implementation
old implementation did not reap abandoned connections
This commit is contained in:
@ -500,6 +500,9 @@ module Discourse
|
||||
ObjectSpace.each_object(ActiveRecord::ConnectionAdapters::ConnectionPool) { |pool| pools << pool }
|
||||
|
||||
pools.each do |pool|
|
||||
# reap recovers connections that were aborted
|
||||
# eg a thread died or a dev forgot to check it in
|
||||
pool.reap
|
||||
pool.drain(idle.seconds, max_age.seconds)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user