From 41453727bf08afe460ba0fe5ccbe72588b64ac03 Mon Sep 17 00:00:00 2001 From: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com> Date: Sun, 23 Jul 2023 10:43:21 +0530 Subject: [PATCH] feat: revert ring.go --- pubsub.go | 2 -- ring.go | 15 ++++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/pubsub.go b/pubsub.go index 79d31aff7..16c0f5672 100644 --- a/pubsub.go +++ b/pubsub.go @@ -33,8 +33,6 @@ type PubSub struct { closed bool exit chan struct{} - err error - cmd *Cmd chOnce sync.Once diff --git a/ring.go b/ring.go index d656656dd..0572ba346 100644 --- a/ring.go +++ b/ring.go @@ -580,9 +580,8 @@ func (c *Ring) Subscribe(ctx context.Context, channels ...string) *PubSub { shard, err := c.sharding.GetByKey(channels[0]) if err != nil { - return &PubSub{ - err: err, - } + // TODO: return PubSub with sticky error + panic(err) } return shard.Client.Subscribe(ctx, channels...) } @@ -595,9 +594,8 @@ func (c *Ring) PSubscribe(ctx context.Context, channels ...string) *PubSub { shard, err := c.sharding.GetByKey(channels[0]) if err != nil { - return &PubSub{ - err: err, - } + // TODO: return PubSub with sticky error + panic(err) } return shard.Client.PSubscribe(ctx, channels...) } @@ -609,9 +607,8 @@ func (c *Ring) SSubscribe(ctx context.Context, channels ...string) *PubSub { } shard, err := c.sharding.GetByKey(channels[0]) if err != nil { - return &PubSub{ - err: err, - } + // TODO: return PubSub with sticky error + panic(err) } return shard.Client.SSubscribe(ctx, channels...) }