在下面的代码中,管道超时是2秒吗?
client = redis.StrictRedis(host=host, port=port, db=0, socket_timeout=2)
pipe = client.pipeline(transaction=False)
for name in namelist:
key = "%s-%s-%s-%s" % (key_sub1, key_sub2, name, key_sub3)
pipe.smembers(key)
pipe.execute()
在Redis中,集合"key"有很多成员。它始终返回以下错误,其中包含最后的代码: In the redis, there are a lot of members in the set "key". It always return the error as below with the code last:
error Error while reading from socket: ('timed out',)
如果我把socket_timeout的值改为10,就会返回ok。
"socket_timeout"参数不是指连接超时吗?但它看起来像是响应超时。
redis-py版本为2.6.7。