mirror of https://github.com/go-redis/redis.git
♻️ Commands that specify keyslots should not try to hash for keyslot location
This commit is contained in:
parent
0e69501b5a
commit
dba9cb31f5
|
@ -767,8 +767,11 @@ func cmdSlot(cmd Cmder, pos int) int {
|
||||||
if pos == 0 {
|
if pos == 0 {
|
||||||
return hashtag.RandomSlot()
|
return hashtag.RandomSlot()
|
||||||
}
|
}
|
||||||
firstKey := cmd.stringArg(pos)
|
val, ok := cmd.Args()[pos].(int)
|
||||||
return hashtag.Slot(firstKey)
|
if ok {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
return hashtag.Slot(cmd.stringArg(pos))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ClusterClient) cmdSlot(cmd Cmder) int {
|
func (c *ClusterClient) cmdSlot(cmd Cmder) int {
|
||||||
|
|
|
@ -74,6 +74,11 @@ func cmdString(cmd Cmder, val interface{}) string {
|
||||||
|
|
||||||
func cmdFirstKeyPos(cmd Cmder, info *CommandInfo) int {
|
func cmdFirstKeyPos(cmd Cmder, info *CommandInfo) int {
|
||||||
switch cmd.Name() {
|
switch cmd.Name() {
|
||||||
|
case "cluster":
|
||||||
|
switch cmd.stringArg(1) {
|
||||||
|
case "getkeysinslot":
|
||||||
|
return 2
|
||||||
|
}
|
||||||
case "eval", "evalsha":
|
case "eval", "evalsha":
|
||||||
if cmd.stringArg(2) != "0" {
|
if cmd.stringArg(2) != "0" {
|
||||||
return 3
|
return 3
|
||||||
|
|
Loading…
Reference in New Issue