Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 838b043..c7f04de 100644
- --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
- +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
- @@ -201,7 +201,7 @@ module ActiveRecord
- def checkout_and_verify(c)
- c.run_callbacks :checkout
- - c.verify!(verification_timeout)
- + c.verify_now!
- @checked_out << c
- c
- end
- diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
- index 005be9d..da67662 100755
- --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
- +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
- @@ -128,11 +128,15 @@ module ActiveRecord
- def verify!(timeout)
- now = Time.now.to_i
- if (now - @last_verification) > timeout
- - reconnect! unless active?
- - @last_verification = now
- + verify_now! now
- end
- end
- + def verify_now!(now = Time.now.to_i)
- + reconnect! unless active?
- + @last_verification = now
- + end
- +
- # Provides access to the underlying database connection. Useful for
- # when you need to call a proprietary method such as postgresql's lo_*
- # methods
Add Comment
Please, Sign In to add comment