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

Method PutClient

pkg/utils/redis/client.go:406–419  ·  view source on GitHub ↗
(c *Client, err error)

Source from the content-addressed store, hash-verified

404}
405
406func (p *Pool) PutClient(c *Client, err error) {
407 p.mu.Lock()
408 defer p.mu.Unlock()
409 if err != nil || p.closed || !p.isRecyclable(c) {
410 c.Close()
411 } else {
412 cache := p.pool[c.Addr]
413 if cache == nil {
414 cache = list.New()
415 p.pool[c.Addr] = cache
416 }
417 cache.PushFront(c)
418 }
419}
420
421func (p *Pool) Info(addr string) (_ map[string]string, err error) {
422 c, err := p.GetClient(addr)

Callers 4

InfoMethod · 0.95
InfoFullMethod · 0.95
RefreshRedisStatsMethod · 0.80
newSlotActionExecutorMethod · 0.80

Calls 2

isRecyclableMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected