From fea57be18ffb069553de9a6e175ff1da8159eabf Mon Sep 17 00:00:00 2001 From: j178 <10510431+j178@users.noreply.github.com> Date: Thu, 6 Oct 2022 04:33:53 +0800 Subject: [PATCH] fix(pubsub): fix break introduced by #2177 --- commands.go | 6 +++--- ring.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commands.go b/commands.go index 0a89baf..cfd6910 100644 --- a/commands.go +++ b/commands.go @@ -352,7 +352,7 @@ type Cmdable interface { PubSubNumSub(ctx context.Context, channels ...string) *MapStringIntCmd PubSubNumPat(ctx context.Context) *IntCmd PubSubShardChannels(ctx context.Context, pattern string) *StringSliceCmd - PubSubShardNumSub(ctx context.Context, channels ...string) *StringIntMapCmd + PubSubShardNumSub(ctx context.Context, channels ...string) *MapStringIntCmd ClusterSlots(ctx context.Context) *ClusterSlotsCmd ClusterNodes(ctx context.Context) *StringCmd @@ -3122,14 +3122,14 @@ func (c cmdable) PubSubShardChannels(ctx context.Context, pattern string) *Strin return cmd } -func (c cmdable) PubSubShardNumSub(ctx context.Context, channels ...string) *StringIntMapCmd { +func (c cmdable) PubSubShardNumSub(ctx context.Context, channels ...string) *MapStringIntCmd { args := make([]interface{}, 2+len(channels)) args[0] = "pubsub" args[1] = "shardnumsub" for i, channel := range channels { args[2+i] = channel } - cmd := NewStringIntMapCmd(ctx, args...) + cmd := NewMapStringIntCmd(ctx, args...) _ = c(ctx, cmd) return cmd } diff --git a/ring.go b/ring.go index 0ae7e64..fa916c6 100644 --- a/ring.go +++ b/ring.go @@ -565,7 +565,7 @@ func (c *Ring) SSubscribe(ctx context.Context, channels ...string) *PubSub { if len(channels) == 0 { panic("at least one channel is required") } - shard, err := c.shards.GetByKey(channels[0]) + shard, err := c.sharding.GetByKey(channels[0]) if err != nil { // TODO: return PubSub with sticky error panic(err)