Merge pull request #18080 from korbin/fix_reaping_frequency_configuration

Fix issue with reaping_frequency type.
This commit is contained in:
Rafael Mendonça França 2015-01-02 01:35:29 -03:00
commit 70c2777d1c
3 changed files with 8 additions and 2 deletions

View File

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

View File

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

View File

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