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

Method Close

pkg/utils/redis/client.go:337–354  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

335}
336
337func (p *Pool) Close() error {
338 p.mu.Lock()
339 defer p.mu.Unlock()
340 if p.closed {
341 return nil
342 }
343 p.closed = true
344 close(p.exit.C)
345
346 for addr, list := range p.pool {
347 for i := list.Len(); i != 0; i-- {
348 c := list.Remove(list.Front()).(*Client)
349 c.Close()
350 }
351 delete(p.pool, addr)
352 }
353 return nil
354}
355
356func (p *Pool) Cleanup() error {
357 p.mu.Lock()

Callers

nothing calls this directly

Calls 2

CloseMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected