mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #18080 from korbin/fix_reaping_frequency_configuration
Fix issue with reaping_frequency type.
This commit is contained in:
commit
70c2777d1c
3 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
* Fix `reaping_frequency` option when the value is a string.
|
||||
|
||||
This usually happens when it is configured using `DATABASE_URL`.
|
||||
|
||||
*korbin*
|
||||
|
||||
* Fix error message when trying to create an associated record and the foreign
|
||||
key is missing.
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ 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]
|
||||
@reaper = Reaper.new(self, (spec.config[:reaping_frequency] && spec.config[:reaping_frequency].to_f))
|
||||
@reaper.run
|
||||
|
||||
# default max pool size to 5
|
||||
|
|
|
@ -60,7 +60,7 @@ module ActiveRecord
|
|||
|
||||
def test_connection_pool_starts_reaper
|
||||
spec = ActiveRecord::Base.connection_pool.spec.dup
|
||||
spec.config[:reaping_frequency] = 0.0001
|
||||
spec.config[:reaping_frequency] = '0.0001'
|
||||
|
||||
pool = ConnectionPool.new spec
|
||||
|
||||
|
|
Loading…
Reference in a new issue