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:
15
sentinel.go
15
sentinel.go
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user