Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry when "Secondary rate limit" error occurs in GitHub API #183

Merged
merged 3 commits into from
Sep 21, 2024

Conversation

snaka
Copy link
Contributor

@snaka snaka commented Sep 20, 2024

fixes #170

Problem to be solved

When using secret.GITHUB_TOKEN as a token to call GitHub API, “Secondary rate limit” error occurred frequently and the process stopped there.

Solution to the problem

If a “Secondary rate limit” error occurs, wait for a certain period of time and retry according to the response header.
Use go-github-ratelimit for retry mechanism.

Test repository

I ran tagpr 10 times with the following repositories and the process was completed successfully without rate limit error.
https://github.com/snaka/tagpr-err-reproduce-with-debug/actions/runs/10957866785

Before the fix, the error occurred frequently (3 times in 12 tries) as follows
https://github.com/snaka/tagpr-err-reproduce/actions/runs/10956692059/job/30423254520

@snaka snaka changed the title Follow the Secondary rate limit error response from GitHub API Retry when "Secondary rate limit" error occurs in GitHub API Sep 20, 2024
@Songmu Songmu merged commit f0e8cf0 into Songmu:main Sep 21, 2024
3 checks passed
@Songmu
Copy link
Owner

Songmu commented Sep 21, 2024

Thank you! Released as v.1.4.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hitting secondary rate limits and other errors when fetching tags
2 participants