Skip to content

Commit f1181b2

Browse files
Cluster determine slot command name need upper
The judgment of the name is all uppercase, for example: L970: if command in ("EVAL", "EVALSHA"):
1 parent 19b55c6 commit f1181b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redis/cluster.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ def determine_slot(self, *args):
956956
determine what slots to map the command to; or, if the keys don't
957957
all map to the same key slot.
958958
"""
959-
command = args[0]
959+
command = args[0].upper()
960960
if self.command_flags.get(command) == SLOT_ID:
961961
# The command contains the slot ID
962962
return args[1]
@@ -971,7 +971,7 @@ def determine_slot(self, *args):
971971
# command syntax: EVAL "script body" num_keys ...
972972
if len(args) <= 2:
973973
raise RedisClusterException(f"Invalid args in command: {args}")
974-
num_actual_keys = args[2]
974+
num_actual_keys = int(args[2])
975975
eval_keys = args[3 : 3 + num_actual_keys]
976976
# if there are 0 keys, that means the script can be run on any node
977977
# so we can just return a random slot

0 commit comments

Comments
 (0)