Fix connection pool close

Close should close successfully acquired connections, not failures.

fixes #45
pull/47/head
Jack Christensen 2014-11-11 17:59:13 -06:00
parent 95e9e0b308
commit efea92e8be
1 changed files with 1 additions and 1 deletions

View File

@ -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()
}
}