summaryrefslogtreecommitdiff
path: root/redis/retry.py
diff options
context:
space:
mode:
authorBar Shaul <88437685+barshaul@users.noreply.github.com>2021-12-23 11:42:30 +0200
committerGitHub <noreply@github.com>2021-12-23 11:42:30 +0200
commitddc51c4ace0caa0787715801b9df42e65c790d46 (patch)
tree50e3a20a53e68ca6eacd73e7c8e93cbcea850d2f /redis/retry.py
parent940d9fc428c3dbe320af003befabe812a8d8537b (diff)
downloadredis-py-ddc51c4ace0caa0787715801b9df42e65c790d46.tar.gz
Support for specifying error types with retry (#1817)
Diffstat (limited to 'redis/retry.py')
-rw-r--r--redis/retry.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/redis/retry.py b/redis/retry.py
index 75504c7..6147fbd 100644
--- a/redis/retry.py
+++ b/redis/retry.py
@@ -19,6 +19,14 @@ class Retry:
self._retries = retries
self._supported_errors = supported_errors
+ def update_supported_erros(self, specified_errors: list):
+ """
+ Updates the supported errors with the specified error types
+ """
+ self._supported_errors = tuple(
+ set(self._supported_errors + tuple(specified_errors))
+ )
+
def call_with_retry(self, do, fail):
"""
Execute an operation that might fail and returns its result, or