mirror of https://github.com/go-redis/redis.git
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),
|
idleConns: make([]*Conn, 0, opt.PoolSize),
|
||||||
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