1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Use first slot/shard when key is not defined.

This commit is contained in:
Vladimir Mihailenco
2016-12-16 14:05:21 +02:00
parent 152cc1ee34
commit 6cd7a09b22
2 changed files with 9 additions and 11 deletions

View File

@ -267,9 +267,6 @@ func (c *Ring) shardByName(name string) (*ringShard, error) {
func (c *Ring) cmdShard(cmd Cmder) (*ringShard, error) {
cmdInfo := c.cmdInfo(cmd.arg(0))
firstKey := cmd.arg(cmdFirstKeyPos(cmd, cmdInfo))
if firstKey == "" {
return c.randomShard()
}
return c.shardByKey(firstKey)
}