[redis] Improve fail parameter of Retry.call_with_retry (#8827)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Nikita Sobolev
2022-10-03 19:48:37 +03:00
committed by GitHub
parent 2ded9e190f
commit 721ad3d785

View File

@@ -1,5 +1,5 @@
from collections.abc import Awaitable, Callable, Iterable
from typing import Any, TypeVar
from typing import TypeVar
from redis.backoff import AbstractBackoff
from redis.exceptions import RedisError
@@ -9,4 +9,4 @@ _T = TypeVar("_T")
class Retry:
def __init__(self, backoff: AbstractBackoff, retries: int, supported_errors: tuple[type[RedisError], ...] = ...) -> None: ...
def update_supported_errors(self, specified_errors: Iterable[type[RedisError]]) -> None: ...
async def call_with_retry(self, do: Callable[[], Awaitable[_T]], fail: Callable[[RedisError], Any]) -> _T: ...
async def call_with_retry(self, do: Callable[[], Awaitable[_T]], fail: Callable[[RedisError], Awaitable[object]]) -> _T: ...