summaryrefslogtreecommitdiff
path: root/redis/connection.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/connection.py')
-rwxr-xr-xredis/connection.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/redis/connection.py b/redis/connection.py
index a2b0074..9c5b536 100755
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -540,7 +540,7 @@ class Connection:
# Add TimeoutError to the errors list to retry on
retry_on_error.append(TimeoutError)
self.retry_on_error = retry_on_error
- if retry_on_error:
+ if retry or retry_on_error:
if retry is None:
self.retry = Retry(NoBackoff(), 1)
else:
@@ -1467,6 +1467,13 @@ class ConnectionPool:
for connection in connections:
connection.disconnect()
+ def set_retry(self, retry: "Retry") -> None:
+ self.connection_kwargs.update({"retry": retry})
+ for conn in self._available_connections:
+ conn.retry = retry
+ for conn in self._in_use_connections:
+ conn.retry = retry
+
class BlockingConnectionPool(ConnectionPool):
"""