Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Favor existing connections over new ones if available

  • Loading branch information...
commit 1712e37c90d0ac74b21589c0ee7b0365cb2b7beb 1 parent 817a07b
Nick Sieger nicksieger authored
6 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
View
@@ -232,10 +232,10 @@ def initialize(spec)
def checkout
# Checkout an available connection
conn = @connection_mutex.synchronize do
- if @connections.length < @size
- checkout_new_connection
- elsif @checked_out.size < @connections.size
+ if @checked_out.size < @connections.size
checkout_existing_connection
+ elsif @connections.size < @size
+ checkout_new_connection
end
end
return conn if conn
Please sign in to comment.
Something went wrong with that request. Please try again.