diff options
author | Eric Lemoine <eric.lemoine@getalma.eu> | 2022-06-19 03:56:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-19 04:56:53 +0300 |
commit | bea72995fd39b01e2f0a1682b16b6c7690933f36 (patch) | |
tree | 477b9093e9664a13add96681a2012ded0ffbc798 /redis/client.py | |
parent | 33702983b8b0a55d29189babb631ea108ee8404f (diff) | |
download | redis-py-bea72995fd39b01e2f0a1682b16b6c7690933f36.tar.gz |
Fix retries in async mode (#2180)
* Avoid mutating a global retry_on_error list
* Make retries config consistent in sync and async
* Fix async retries
* Add new TestConnectionConstructorWithRetry tests
Diffstat (limited to 'redis/client.py')
-rwxr-xr-x | redis/client.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/redis/client.py b/redis/client.py index fcc2758..86061d5 100755 --- a/redis/client.py +++ b/redis/client.py @@ -914,7 +914,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands, SentinelCommands): errors=None, decode_responses=False, retry_on_timeout=False, - retry_on_error=[], + retry_on_error=None, ssl=False, ssl_keyfile=None, ssl_certfile=None, @@ -958,6 +958,8 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands, SentinelCommands): ) ) encoding_errors = errors + if not retry_on_error: + retry_on_error = [] if retry_on_timeout is True: retry_on_error.append(TimeoutError) kwargs = { |