MCPcopy Index your code
hub / github.com/CodisLabs/codis / NewPool

Function NewPool

pkg/utils/redis/client.go:305–328  ·  view source on GitHub ↗
(auth string, timeout time.Duration)

Source from the content-addressed store, hash-verified

303}
304
305func NewPool(auth string, timeout time.Duration) *Pool {
306 p := &Pool{
307 auth: auth, timeout: timeout,
308 pool: make(map[string]*list.List),
309 }
310 p.exit.C = make(chan struct{})
311
312 if timeout != 0 {
313 go func() {
314 var ticker = time.NewTicker(time.Minute)
315 defer ticker.Stop()
316 for {
317 select {
318 case <-p.exit.C:
319 return
320 case <-ticker.C:
321 p.Cleanup()
322 }
323 }
324 }()
325 }
326
327 return p
328}
329
330func (p *Pool) isRecyclable(c *Client) bool {
331 if c.conn.Err() != nil {

Callers

nothing calls this directly

Calls 1

CleanupMethod · 0.95

Tested by

no test coverage detected