mirror of https://github.com/go-redis/redis.git
removed unnecessary variable
This commit is contained in:
parent
0bc34b8a83
commit
5a5d911a98
|
@ -164,17 +164,12 @@ 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) {
|
||||||
var poolExhausted bool
|
|
||||||
|
|
||||||
p.connsMu.Lock()
|
p.connsMu.Lock()
|
||||||
if p.cfg.PoolSizeStrict {
|
if p.cfg.PoolSizeStrict && len(p.conns) >= p.poolSize {
|
||||||
poolExhausted = len(p.conns) >= p.poolSize
|
p.connsMu.Unlock()
|
||||||
}
|
|
||||||
p.connsMu.Unlock()
|
|
||||||
|
|
||||||
if poolExhausted {
|
|
||||||
return nil, ErrPoolExhausted
|
return nil, ErrPoolExhausted
|
||||||
}
|
}
|
||||||
|
p.connsMu.Unlock()
|
||||||
|
|
||||||
cn, err := p.dialConn(ctx, pooled)
|
cn, err := p.dialConn(ctx, pooled)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue