Skip to content

Commit

Permalink
Improve documentation a little bit (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
inyutin authored Oct 26, 2024
1 parent 02fbb8d commit 1f050a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ class RetryOptionsBase:
def __init__(
self,
attempts: int = 3, # How many times we should retry
statuses: Optional[Iterable[int]] = None, # On which statuses we should retry
exceptions: Optional[Iterable[Type[Exception]]] = None, # On which exceptions we should retry
statuses: Iterable[int] | None = None, # On which statuses we should retry
exceptions: Iterable[type[Exception]] | None = None, # On which exceptions we should retry, by default on all
retry_all_server_errors: bool = True, # If should retry all 500 errors or not
# a callback that will run on response to decide if retry
evaluate_response_callback: Optional[EvaluateResponseCallbackType] = None,
evaluate_response_callback: EvaluateResponseCallbackType | None = None,
):
...

Expand Down Expand Up @@ -195,16 +195,17 @@ for more info see [aiohttp doc](https://docs.aiohttp.org/en/stable/client_advanc
class RequestParams:
method: str
url: _RAW_URL_TYPE
trace_request_ctx: Optional[Dict[str, Any]] = None
kwargs: Optional[Dict[str, Any]] = None
headers: dict[str, Any] | None = None
trace_request_ctx: dict[str, Any] | None = None
kwargs: dict[str, Any] | None = None
```

```python
def requests(
self,
params_list: List[RequestParams],
retry_options: Optional[RetryOptionsBase] = None,
raise_for_status: Optional[bool] = None,
params_list: list[RequestParams],
retry_options: RetryOptionsBase | None = None,
raise_for_status: bool | None = None,
) -> _RequestContext:
```

Expand Down
2 changes: 1 addition & 1 deletion aiohttp_retry/retry_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(
self,
attempts: int = 3, # How many times we should retry
statuses: Iterable[int] | None = None, # On which statuses we should retry
exceptions: Iterable[type[Exception]] | None = None, # On which exceptions we should retry
exceptions: Iterable[type[Exception]] | None = None, # On which exceptions we should retry, by default on all
retry_all_server_errors: bool = True, # If should retry all 500 errors or not
# a callback that will run on response to decide if retry
evaluate_response_callback: EvaluateResponseCallbackType | None = None,
Expand Down

0 comments on commit 1f050a5

Please sign in to comment.