diff options
Diffstat (limited to 'plugins/redis/plugin.go')
-rw-r--r-- | plugins/redis/plugin.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/redis/plugin.go b/plugins/redis/plugin.go index 7b5721f4..b2603a40 100644 --- a/plugins/redis/plugin.go +++ b/plugins/redis/plugin.go @@ -164,14 +164,14 @@ func (p *Plugin) Unsubscribe(connectionID string, topics ...string) error { for i := 0; i < len(topics); i++ { // if there are no such topics, we can safely unsubscribe from the redis - ssc := p.universalClient.SMembers(context.Background(), topics[i]) - res, err := ssc.Result() + exists := p.universalClient.Exists(context.Background(), topics[i]) + res, err := exists.Result() if err != nil { return err } // if we have associated connections - skip - if len(res) > 0 { + if res == 1 { // exists means that topic still exists and some other nodes may have connections associated with it continue } |