mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-19 04:50:02 +02:00
api/redis/subscriber.go: Adding context as first parameter to NewSubscriber()
This commit is contained in:
parent
c1efffd4ba
commit
f9124c2864
4 changed files with 11 additions and 9 deletions
|
|
@ -27,10 +27,10 @@ func WithTimeout(value time.Duration) SubscriberOption {
|
|||
}
|
||||
}
|
||||
|
||||
func NewSubscriber(client *redis.Client, ns Namespace, options ...SubscriberOption) *Subscriber {
|
||||
func NewSubscriber(ctx context.Context, client *redis.Client, ns Namespace, options ...SubscriberOption) *Subscriber {
|
||||
sub := &Subscriber{
|
||||
ctx: client.Context(),
|
||||
sub: client.PSubscribe(client.Context()),
|
||||
ctx: ctx,
|
||||
sub: client.PSubscribe(ctx),
|
||||
channels: make(map[string]chan []byte),
|
||||
timeout: time.Millisecond * 200,
|
||||
ns: ns,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue