forked from mirror/redis
Merge pull request #1315 from lwightmoon/master
fix NewConnPool checkMinIdleConns data race
This commit is contained in:
commit
64bb0b7f3a
|
@ -94,7 +94,9 @@ func NewConnPool(opt *Options) *ConnPool {
|
||||||
closedCh: make(chan struct{}),
|
closedCh: make(chan struct{}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.connsMu.Lock()
|
||||||
p.checkMinIdleConns()
|
p.checkMinIdleConns()
|
||||||
|
p.connsMu.Unlock()
|
||||||
|
|
||||||
if opt.IdleTimeout > 0 && opt.IdleCheckFrequency > 0 {
|
if opt.IdleTimeout > 0 && opt.IdleCheckFrequency > 0 {
|
||||||
go p.reaper(opt.IdleCheckFrequency)
|
go p.reaper(opt.IdleCheckFrequency)
|
||||||
|
|
Loading…
Reference in New Issue