diff options
author | Xavier Noria <fxn@hashref.com> | 2016-05-08 23:54:40 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-05-08 23:54:40 +0200 |
commit | a0b3de3002bd9f608b3a9e41e702762b10430207 (patch) | |
tree | 14089b9cca8a63bacd2157b6072dc9ed61f94ba1 | |
parent | dca4b9f82ab442ade62442ad3177c203fd1bdec7 (diff) | |
parent | ce8b0cbf343331b717ec2b02abc29dc5b573d1c0 (diff) | |
download | rails-a0b3de3002bd9f608b3a9e41e702762b10430207.tar.gz rails-a0b3de3002bd9f608b3a9e41e702762b10430207.tar.bz2 rails-a0b3de3002bd9f608b3a9e41e702762b10430207.zip |
Merge pull request #24925 from Neodelf/again_with_loop
Replacement cycle for readability
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 33f68d0b97..1bea16ebcc 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -298,7 +298,7 @@ module ActiveRecord def run return unless frequency Thread.new(frequency, pool) { |t, p| - while true + loop do sleep t p.reap end @@ -618,7 +618,7 @@ module ActiveRecord timeout_time = Time.now + (@checkout_timeout * 2) @available.with_a_bias_for(Thread.current) do - while true + loop do synchronize do return if collected_conns.size == @connections.size && @now_connecting == 0 remaining_timeout = timeout_time - Time.now |