2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

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