Skip to content

Commit

Permalink
chore: get retry after value in a pythonic way
Browse files Browse the repository at this point in the history
it uses the python framework to solve the problem related to retry after returns a string like "50, 49" in retry response header when the status code is 429

issue related: airbytehq#13673
  • Loading branch information
brunousml committed Jun 29, 2022
1 parent 62017d5 commit e68a7b9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def backoff_time(self, response: requests.Response) -> Union[int, float]:
The response has a Retry-After header that tells you for how many seconds to wait before retrying.
"""

retry_after = int(to_int(response.headers.get("Retry-After", 0)))
retry_after = int(response.headers.get("Retry-After", "0").split(",")[0])
if retry_after > 0:
return retry_after

Expand Down

0 comments on commit e68a7b9

Please sign in to comment.