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
1 changed files with 3 additions and 0 deletions

View File

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