1
0
mirror of https://github.com/redis/go-redis.git synced 2025-04-19 07:22:17 +03:00

stop ConnPool.tryDial goroutine if pool was closed

This commit is contained in:
Nikolay Sivko 2017-08-04 01:11:35 +03:00
parent a8ee44122a
commit 7ae26b74bc

View File

@ -119,6 +119,9 @@ func (p *ConnPool) NewConn() (*Conn, error) {
func (p *ConnPool) tryDial() { func (p *ConnPool) tryDial() {
for { for {
if p.closed() {
return
}
conn, err := p.opt.Dialer() conn, err := p.opt.Dialer()
if err != nil { if err != nil {
p.setLastDialError(err) p.setLastDialError(err)