提交 edeb251f 编写于 作者: R Ryuta Kamizono

Start `@reaper.run` after connection pool initialized

Otherwise `ConnectionPool#reap` may run before `@connections` has
initialized.

https://travis-ci.org/rails/rails/jobs/263037427#L888-L890
上级 da589fcc
......@@ -326,8 +326,6 @@ def initialize(spec)
@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 @@ def initialize(spec)
@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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册