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

Method context

redis.go:1033–1038  ·  view source on GitHub ↗

context returns the context for the current connection. If the context timeout is enabled, it returns the original context. Otherwise, it returns a new background context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1031// If the context timeout is enabled, it returns the original context.
1032// Otherwise, it returns a new background context.
1033func (c *baseClient) context(ctx context.Context) context.Context {
1034 if c.opt.ContextTimeoutEnabled {
1035 return ctx
1036 }
1037 return context.Background()
1038}
1039
1040// createInitConnFunc creates a connection initialization function that can be used for reconnections.
1041func (c *baseClient) createInitConnFunc() func(context.Context, *pool.Conn) error {

Callers 3

_processMethod · 0.95
pipelineProcessCmdsMethod · 0.95
txPipelineProcessCmdsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected