diff options
author | Bar Shaul <88437685+barshaul@users.noreply.github.com> | 2021-12-23 11:42:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-23 11:42:30 +0200 |
commit | ddc51c4ace0caa0787715801b9df42e65c790d46 (patch) | |
tree | 50e3a20a53e68ca6eacd73e7c8e93cbcea850d2f /redis/retry.py | |
parent | 940d9fc428c3dbe320af003befabe812a8d8537b (diff) | |
download | redis-py-ddc51c4ace0caa0787715801b9df42e65c790d46.tar.gz |
Support for specifying error types with retry (#1817)
Diffstat (limited to 'redis/retry.py')
-rw-r--r-- | redis/retry.py | 8 |
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 |