Skip to content

Commit

Permalink
Add 503 status code to retry
Browse files Browse the repository at this point in the history
  • Loading branch information
Eu Jing Chua committed Feb 11, 2025
1 parent e94989e commit e6e4aa3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ def _get_session(self, params: dict) -> requests.Session:
session = requests.Session()
session.mount(
"https://",
HTTPAdapter(max_retries=Retry(total=total_retries, backoff_factor=backoff_factor)),
HTTPAdapter(
max_retries=Retry(
total=total_retries, backoff_factor=backoff_factor, status_forcelist=[503]
)
),
)
session.headers.update(self._get_headers())
return session
Expand Down

0 comments on commit e6e4aa3

Please sign in to comment.