MCPcopy
hub / github.com/redis/go-redis / getConn

Method getConn

redis.go:383–400  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

381}
382
383func (c *baseClient) getConn(ctx context.Context) (*pool.Conn, error) {
384 if c.opt.Limiter != nil {
385 err := c.opt.Limiter.Allow()
386 if err != nil {
387 return nil, err
388 }
389 }
390
391 cn, err := c._getConn(ctx)
392 if err != nil {
393 if c.opt.Limiter != nil {
394 c.opt.Limiter.ReportResult(err)
395 }
396 return nil, err
397 }
398
399 return cn, nil
400}
401
402func (c *baseClient) _getConn(ctx context.Context) (*pool.Conn, error) {
403 cn, err := c.connPool.Get(ctx)

Callers 3

withConnMethod · 0.95
processPipelineNodeMethod · 0.45
processTxPipelineNodeMethod · 0.45

Calls 3

_getConnMethod · 0.95
AllowMethod · 0.80
ReportResultMethod · 0.80

Tested by

no test coverage detected