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

Pick random node when command does not have keys

This commit is contained in:
Vladimir Mihailenco
2017-12-28 16:41:05 +02:00
parent cfed9ab470
commit 3de5605ab2
5 changed files with 49 additions and 9 deletions

View File

@ -82,13 +82,13 @@ func cmdFirstKeyPos(cmd Cmder, info *CommandInfo) int {
if cmd.stringArg(2) != "0" {
return 3
} else {
return -1
return 0
}
case "publish":
return 1
}
if info == nil {
return -1
return 0
}
return int(info.FirstKeyPos)
}