forked from mirror/redis
fix data race
This commit is contained in:
parent
c9f2e839d2
commit
4d5f8a5df3
|
@ -93,8 +93,9 @@ func NewConnPool(opt *Options) *ConnPool {
|
|||
idleConns: make([]*Conn, 0, opt.PoolSize),
|
||||
closedCh: make(chan struct{}),
|
||||
}
|
||||
|
||||
p.connsMu.Lock()
|
||||
p.checkMinIdleConns()
|
||||
p.connsMu.Unlock()
|
||||
|
||||
if opt.IdleTimeout > 0 && opt.IdleCheckFrequency > 0 {
|
||||
go p.reaper(opt.IdleCheckFrequency)
|
||||
|
|
Loading…
Reference in New Issue