Skip to content

Commit

Permalink
fix: set max wait time at 10 seconds (#538)
Browse files Browse the repository at this point in the history
* fix: set max wait time at 10 seconds

* fix: update tests

* fix: retry_after can be None
  • Loading branch information
thomasrockhu-codecov committed May 3, 2024
1 parent 271d368 commit 61a953b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion upload/tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -2774,7 +2774,7 @@ def test_github_actions_rate_limit_error(self, mock_get_torngit):
TokenlessUploadHandler("github_actions", params).verify_upload()
self.assertEqual(
str(e.exception.detail),
"Rate limit reached. Please upload with the Codecov repository upload token to resolve issue. Expected available in 20 seconds.",
"Rate limit reached. Please upload with the Codecov repository upload token to resolve issue. Expected available in 10 seconds.",
)

mock_get.reset_mock()
Expand Down
2 changes: 1 addition & 1 deletion upload/tokenless/github_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_build(self):
else:
retry_after = None
raise exceptions.Throttled(
wait=retry_after,
wait=min(10, retry_after) if type(retry_after) == int else retry_after,
detail="Rate limit reached. Please upload with the Codecov repository upload token to resolve issue.",
)
except TorngitClientError as e:
Expand Down

0 comments on commit 61a953b

Please sign in to comment.