@@ -967,11 +967,11 @@ def determine_slot(self, *args):
967
967
# redis server to parse the keys. Besides, there is a bug in redis<7.0
968
968
# where `self._get_command_keys()` fails anyway. So, we special case
969
969
# EVAL/EVALSHA.
970
- if command in ("EVAL" , "EVALSHA" ):
970
+ if command . upper () in ("EVAL" , "EVALSHA" ):
971
971
# command syntax: EVAL "script body" num_keys ...
972
972
if len (args ) <= 2 :
973
973
raise RedisClusterException (f"Invalid args in command: { args } " )
974
- num_actual_keys = args [2 ]
974
+ num_actual_keys = int ( args [2 ])
975
975
eval_keys = args [3 : 3 + num_actual_keys ]
976
976
# if there are 0 keys, that means the script can be run on any node
977
977
# so we can just return a random slot
@@ -983,7 +983,7 @@ def determine_slot(self, *args):
983
983
if keys is None or len (keys ) == 0 :
984
984
# FCALL can call a function with 0 keys, that means the function
985
985
# can be run on any node so we can just return a random slot
986
- if command in ("FCALL" , "FCALL_RO" ):
986
+ if command . upper () in ("FCALL" , "FCALL_RO" ):
987
987
return random .randrange (0 , REDIS_CLUSTER_HASH_SLOTS )
988
988
raise RedisClusterException (
989
989
"No way to dispatch this command to Redis Cluster. "
0 commit comments