mirror of
https://github.com/redis/go-redis.git
synced 2025-06-12 14:21:52 +03:00
Add optimization for '*' pattern in PubSubChannels.
This commit is contained in:
@ -1212,7 +1212,11 @@ func (c *Client) DebugObject(key string) *StringCmd {
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
func (c *Client) PubSubChannels(pattern string) *StringSliceCmd {
|
||||
cmd := NewStringSliceCmd("PUBSUB", "CHANNELS", pattern)
|
||||
args := []string{"PUBSUB", "CHANNELS"}
|
||||
if pattern != "*" {
|
||||
args = append(args, pattern)
|
||||
}
|
||||
cmd := NewStringSliceCmd(args...)
|
||||
c.Process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
Reference in New Issue
Block a user