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

Method withTimeout

redis.go:368–377  ·  view source on GitHub ↗
(timeout time.Duration)

Source from the content-addressed store, hash-verified

366}
367
368func (c *baseClient) withTimeout(timeout time.Duration) *baseClient {
369 opt := c.cloneOpt()
370 opt.ReadTimeout = timeout
371 opt.WriteTimeout = timeout
372
373 clone := c.clone()
374 clone.opt = opt
375
376 return clone
377}
378
379func (c *baseClient) String() string {
380 return fmt.Sprintf("Redis<%s db:%d>", c.getAddr(), c.opt.DB)

Callers 1

WithTimeoutMethod · 0.80

Calls 2

cloneOptMethod · 0.95
cloneMethod · 0.95

Tested by

no test coverage detected