From efea92e8becf64a6b65aa06d0e9d688ed01ecfef Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Tue, 11 Nov 2014 17:59:13 -0600 Subject: [PATCH] Fix connection pool close Close should close successfully acquired connections, not failures. fixes #45 --- conn_pool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conn_pool.go b/conn_pool.go index a0f8185a..3be0c23a 100644 --- a/conn_pool.go +++ b/conn_pool.go @@ -125,7 +125,7 @@ func (p *ConnPool) Release(conn *Conn) { // Close ends the use of a connection pool by closing all underlying connections. func (p *ConnPool) Close() { for i := 0; i < p.maxConnections; i++ { - if c, err := p.Acquire(); err != nil { + if c, err := p.Acquire(); err == nil { _ = c.Close() } }