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

♻️ Commands that specify keyslots should not try to hash for keyslot location

This commit is contained in:
Jake Gregg
2019-01-31 15:47:13 -08:00
parent 0e69501b5a
commit dba9cb31f5
2 changed files with 10 additions and 2 deletions

View File

@ -767,8 +767,11 @@ func cmdSlot(cmd Cmder, pos int) int {
if pos == 0 {
return hashtag.RandomSlot()
}
firstKey := cmd.stringArg(pos)
return hashtag.Slot(firstKey)
val, ok := cmd.Args()[pos].(int)
if ok {
return val
}
return hashtag.Slot(cmd.stringArg(pos))
}
func (c *ClusterClient) cmdSlot(cmd Cmder) int {