This commit is contained in:
Classic298 2026-09-30 19:07:19 +04:00 • committed by GitHub
commit c91f995395
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -334,7 +334,9 @@ def get_redis_connection(
)
elif redis_url:
factory = getattr(redis_mod, 'from_url', None) or redis_mod.Redis.from_url
connection = factory(redis_url, decode_responses=decode_responses, **extra)
# reconnect once when Redis has closed a pooled connection, e.g. after a restart
retry = redis_mod.retry.Retry(_redis_sync.backoff.NoBackoff(), 1, supported_errors=(redis_mod.ConnectionError,))
connection = factory(redis_url, decode_responses=decode_responses, retry=retry, **extra)
_CONNECTION_POOL[cache_key] = connection
return connection