Skip to content

Commit

Permalink
Merge pull request #18080 from korbin/fix_reaping_frequency_configura…
Browse files Browse the repository at this point in the history
…tion

Fix issue with reaping_frequency type.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
  • Loading branch information
rafaelfranca committed Jan 2, 2015
1 parent 81d9a51 commit f375003
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions 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*

* `db:schema:load` and `db:structure:load` no longer purge the database
before loading the schema. This is left for the user to do.
`db:test:prepare` will still purge the database.
Expand Down
Expand Up @@ -238,7 +238,7 @@ def initialize(spec)

@checkout_timeout = (spec.config[:checkout_timeout] && spec.config[:checkout_timeout].to_f) || 5
@dead_connection_timeout = (spec.config[:dead_connection_timeout] && spec.config[:dead_connection_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
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/reaper_test.rb
Expand Up @@ -61,7 +61,7 @@ def test_reaping_frequency_configuration

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
pool.dead_connection_timeout = 0
Expand Down

0 comments on commit f375003

Please sign in to comment.