diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 01:35:29 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 01:37:07 -0300 |
commit | 70c2777d1c2bfaf538c5bc892a5c3f96f67291f1 (patch) | |
tree | da637ec1b0c6a1ba9e1dd5cfddd982b41ecfe7b3 | |
parent | 7c6861b0bc85077ed1f1dcb4a919de0f1b8d490d (diff) | |
parent | 27955b4bb11fc6a7ee8a0fcaff53b6fc175a9655 (diff) | |
download | rails-70c2777d1c2bfaf538c5bc892a5c3f96f67291f1.tar.gz rails-70c2777d1c2bfaf538c5bc892a5c3f96f67291f1.tar.bz2 rails-70c2777d1c2bfaf538c5bc892a5c3f96f67291f1.zip |
Merge pull request #18080 from korbin/fix_reaping_frequency_configuration
Fix issue with reaping_frequency type.
-rw-r--r-- | activerecord/CHANGELOG.md | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/reaper_test.rb | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 859ba38588..ea8c8088a9 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -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. 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 3968b90341..6235745fb2 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -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 diff --git a/activerecord/test/cases/reaper_test.rb b/activerecord/test/cases/reaper_test.rb index f52fd22489..cccfc6774e 100644 --- a/activerecord/test/cases/reaper_test.rb +++ b/activerecord/test/cases/reaper_test.rb @@ -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 |