From 7c8a63e9efc9210f0ec1de9b1b8ea7defa1ec946 Mon Sep 17 00:00:00 2001 From: Rueian Date: Sun, 15 Sep 2024 21:43:07 -0700 Subject: [PATCH] fix: panic on rueidiscompat.SSubscribe due to unnecessary PING (#636) Signed-off-by: Rueian --- rueidiscompat/pubsub.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rueidiscompat/pubsub.go b/rueidiscompat/pubsub.go index e89a98d8..80990a8e 100644 --- a/rueidiscompat/pubsub.go +++ b/rueidiscompat/pubsub.go @@ -282,7 +282,7 @@ func (p *pubsub) resubscribe(ctx context.Context) rueidis.DedicatedClient { defer p.mu.Unlock() retry: c := p.mconn() - ok := false + ok := len(p.schannels) == 0 && len(p.channels) == 0 && len(p.patterns) == 0 if len(p.schannels) != 0 { builder := c.B().Ssubscribe().Channel() for channel, ok := range p.schannels {