FIX: pool drainer to use Rails 5.2 implementation

old implementation did not reap abandoned connections
This commit is contained in:
Sam
2018-06-14 15:54:48 +10:00
parent 8fc08aad09
commit 71aa20bd30
3 changed files with 23 additions and 23 deletions

View File

@ -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