Skip to content

Commit

Permalink
Add retry on 429 error code
Browse files Browse the repository at this point in the history
  • Loading branch information
hovaesco committed Mar 1, 2024
1 parent 00435d6 commit d18dae0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trino/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ def max_attempts(self, value) -> None:
self._handle_retry,
handled_exceptions=self._exceptions,
conditions=(
# need retry when there is no exception but the status code is 502, 503, or 504
# need retry when there is no exception but the status code is 429, 502, 503, or 504
lambda response: getattr(response, "status_code", None)
in (502, 503, 504),
in (429, 502, 503, 504),
),
max_attempts=self._max_attempts,
)
Expand Down

0 comments on commit d18dae0

Please sign in to comment.