套接字超时重写StrictRedis中的BRPOP timeout参数

2024-09-26 22:51:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我遇到了一个问题,一个重用的带有socket_timeout参数的StrictRedis连接正在用无限超时覆盖brpop命令。有什么想法吗?在

redis_audience = StrictRedis(host=host,
                             port=port,
                             db=1,
                             socket_timeout=10,  # the culprit
                             socket_connect_timeout=10)

redis_audience.brpop(key, timeout=0)  # this will fail after 10 seconds

Tags: thekey命令redishostdb参数port

热门问题