mirror of https://github.com/go-redis/redis.git
fix check pool exhausted
This commit is contained in:
parent
5a5d911a98
commit
76ee74e944
|
@ -165,7 +165,7 @@ func (p *ConnPool) NewConn(ctx context.Context) (*Conn, error) {
|
||||||
|
|
||||||
func (p *ConnPool) newConn(ctx context.Context, pooled bool) (*Conn, error) {
|
func (p *ConnPool) newConn(ctx context.Context, pooled bool) (*Conn, error) {
|
||||||
p.connsMu.Lock()
|
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()
|
p.connsMu.Unlock()
|
||||||
return nil, ErrPoolExhausted
|
return nil, ErrPoolExhausted
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue