diff options
author | Matthew Draper <matthew@trebex.net> | 2017-08-11 03:37:23 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-11 03:37:23 +0930 |
commit | 8f44d1661981a57838543b8a9890c855d7b02b89 (patch) | |
tree | ef8812bdc0eaecd139e5741915b8aea18285b118 | |
parent | a3f7407e7c0bdfafda4c574e12a68e9cbbef82c5 (diff) | |
parent | edeb251fb73f92b8d9115c4f3c7bb46fcee10c67 (diff) | |
download | rails-8f44d1661981a57838543b8a9890c855d7b02b89.tar.gz rails-8f44d1661981a57838543b8a9890c855d7b02b89.tar.bz2 rails-8f44d1661981a57838543b8a9890c855d7b02b89.zip |
Merge pull request #30183 from kamipo/reaper_run_after_conn_pool_initialized
Start `@reaper.run` after connection pool initialized
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb index c11b7b012f..11b5f48dc7 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -326,8 +326,6 @@ module ActiveRecord @spec = spec @checkout_timeout = (spec.config[:checkout_timeout] && spec.config[:checkout_timeout].to_f) || 5 - @reaper = Reaper.new(self, (spec.config[:reaping_frequency] && spec.config[:reaping_frequency].to_f)) - @reaper.run # default max pool size to 5 @size = (spec.config[:pool] && spec.config[:pool].to_i) || 5 @@ -357,6 +355,9 @@ module ActiveRecord @available = ConnectionLeasingQueue.new self @lock_thread = false + + @reaper = Reaper.new(self, spec.config[:reaping_frequency] && spec.config[:reaping_frequency].to_f) + @reaper.run end def lock_thread=(lock_thread) |