fix check pool exhausted

This commit is contained in:
Nikolay Vorobev 2023-11-17 01:29:50 +03:00
parent 5a5d911a98
commit 76ee74e944
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ func (p *ConnPool) NewConn(ctx context.Context) (*Conn, error) {
func (p *ConnPool) newConn(ctx context.Context, pooled bool) (*Conn, error) {
p.connsMu.Lock()
if p.cfg.PoolSizeStrict && len(p.conns) >= p.poolSize {
if p.cfg.PoolSizeStrict && len(p.conns) >= p.cfg.PoolSize {
p.connsMu.Unlock()
return nil, ErrPoolExhausted
}