Skip to content

Commit

Permalink
Cluster determine slot command name need upper
Browse files Browse the repository at this point in the history
The judgment of the name is all uppercase, for example:
    L970: if command in ("EVAL", "EVALSHA"):
  • Loading branch information
yangbodong22011 committed Aug 29, 2023
1 parent 19b55c6 commit f1181b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redis/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ def determine_slot(self, *args):
determine what slots to map the command to; or, if the keys don't
all map to the same key slot.
"""
command = args[0]
command = args[0].upper()
if self.command_flags.get(command) == SLOT_ID:
# The command contains the slot ID
return args[1]
Expand All @@ -971,7 +971,7 @@ def determine_slot(self, *args):
# command syntax: EVAL "script body" num_keys ...
if len(args) <= 2:
raise RedisClusterException(f"Invalid args in command: {args}")
num_actual_keys = args[2]
num_actual_keys = int(args[2])
eval_keys = args[3 : 3 + num_actual_keys]
# if there are 0 keys, that means the script can be run on any node
# so we can just return a random slot
Expand Down

0 comments on commit f1181b2

Please # to comment.