1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

chore: remove WithContext

This commit is contained in:
Vladimir Mihailenco
2022-06-05 09:58:05 +03:00
parent 0768a688c6
commit 4ddd7d1803
10 changed files with 2 additions and 147 deletions

View File

@ -256,7 +256,6 @@ func masterReplicaDialer(
type SentinelClient struct {
*baseClient
hooks
ctx context.Context
}
func NewSentinelClient(opt *Options) *SentinelClient {
@ -266,24 +265,10 @@ func NewSentinelClient(opt *Options) *SentinelClient {
opt: opt,
connPool: newConnPool(opt),
},
ctx: context.Background(),
}
return c
}
func (c *SentinelClient) Context() context.Context {
return c.ctx
}
func (c *SentinelClient) WithContext(ctx context.Context) *SentinelClient {
if ctx == nil {
panic("nil context")
}
clone := *c
clone.ctx = ctx
return &clone
}
func (c *SentinelClient) Process(ctx context.Context, cmd Cmder) error {
return c.hooks.process(ctx, cmd, c.baseClient.process)
}