Traceback (most recent call last):
File "XXX\Python38\lib\site-packages\rediscluster\client.py", line 555, in execute_command
return self._execute_command(*args, **kwargs)
File "XXX\Python38\lib\site-packages\rediscluster\client.py", line 588, in _execute_command
slot = self._determine_slot(*args)
File "XXX\Python38\lib\site-packages\rediscluster\client.py", line 486, in _determine_slot
keys = args[3: 3 + numkeys]
TypeError: unsupported operand type(s) for +: 'int' and 'str'
when i use execute_command and try to execute EVALSHA command, just like:
if command in ['EVAL', 'EVALSHA']:
numkeys = args[2]
keys = args[3: 3 + numkeys]
slots = {self.connection_pool.nodes.keyslot(key) for key in keys}
if len(slots) != 1:
raise RedisClusterException("{0} - all keys must map to the same key slot".format(command))
return slots.pop()
the param "2" pass to args[2] , so numkeys is "2", type of str,
then raise this Exception;
Is this a bug, or am I wrong?
if i pass 2 rather than "2" , is ok.
but got another problem,
eval/evalsha command keys must be in same slot
this https://redis.io/commands/cluster-keyslot helps me!
when i use
execute_command
and try to executeEVALSHA
command, just like:in python like:
https://github.com/Grokzen/redis-py-cluster/blob/master/rediscluster/client.py#L486
the param "2" pass to args[2] , so numkeys is "2", type of str, then raise this Exception; Is this a bug, or am I wrong?