fix(redis): use await asyncio.sleep() instead of time.sleep() in async generator

time.sleep() inside the _wrap_async_gen() async generator blocks the
entire event loop during Sentinel failover retries. The sibling method
_wrap_async_call() already correctly uses await asyncio.sleep().
This commit is contained in:
silentoplayz 2026-06-08 07:30:03 -04:00
parent b1d40f3409
commit 1ec691209a

View file

@ -185,7 +185,7 @@ class SentinelRedisProxy:
if proxy._should_retry(attempt):
proxy._log_retry(exc, attempt)
if REDIS_RECONNECT_DELAY:
time.sleep(REDIS_RECONNECT_DELAY / 1000)
await asyncio.sleep(REDIS_RECONNECT_DELAY / 1000)
continue
proxy._log_exhausted(exc)
raise