mirror of https://github.com/go-redis/redis.git
Merge pull request #50 from go-redis/fix/upgrade-to-redis-2814
Fix PubSubNumSub to work with Redis 2.8.14.
This commit is contained in:
commit
f790046fea
|
@ -1221,10 +1221,10 @@ func (c *Client) PubSubChannels(pattern string) *StringSliceCmd {
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) PubSubNumSub(channels ...string) *StringSliceCmd {
|
func (c *Client) PubSubNumSub(channels ...string) *SliceCmd {
|
||||||
args := []string{"PUBSUB", "NUMSUB"}
|
args := []string{"PUBSUB", "NUMSUB"}
|
||||||
args = append(args, channels...)
|
args = append(args, channels...)
|
||||||
cmd := NewStringSliceCmd(args...)
|
cmd := NewSliceCmd(args...)
|
||||||
c.Process(cmd)
|
c.Process(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
|
@ -2597,7 +2597,7 @@ func (t *RedisTest) TestPubSubNumSub(c *C) {
|
||||||
c.Assert(
|
c.Assert(
|
||||||
channels,
|
channels,
|
||||||
DeepEquals,
|
DeepEquals,
|
||||||
[]string{"mychannel", "1", "mychannel2", "1", "mychannel3", "0"},
|
[]interface{}{"mychannel", int64(1), "mychannel2", int64(1), "mychannel3", int64(0)},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue