mirror of https://github.com/jackc/pgx.git
Fix connection pool close
Close should close successfully acquired connections, not failures. fixes #45pull/47/head
parent
95e9e0b308
commit
efea92e8be
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue