提交 1712e37c 编写于 作者: N Nick Sieger

Favor existing connections over new ones if available

上级 817a07b4
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册