Fix connection pool close
Close should close successfully acquired connections, not failures. fixes #45
This commit is contained in:
+1
-1
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user