diff --git a/internal/pool/pool.go b/internal/pool/pool.go index bbf5b30..36f6953 100644 --- a/internal/pool/pool.go +++ b/internal/pool/pool.go @@ -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)