mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
Merge pull request #745 from un000/master
Properly close a pool on "not lazy" connect
This commit is contained in:
commit
c65fd8e2df
@ -189,7 +189,7 @@ func ConnectConfig(ctx context.Context, config *Config) (*Pool, error) {
|
|||||||
// Initially establish one connection
|
// Initially establish one connection
|
||||||
res, err := p.p.Acquire(ctx)
|
res, err := p.p.Acquire(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.p.Close()
|
p.Close()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
res.Release()
|
res.Release()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user