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

Display Retry-After when hitting rate limits #2062

Open
kwavnet opened this issue Jun 15, 2023 · 2 comments
Open

Display Retry-After when hitting rate limits #2062

kwavnet opened this issue Jun 15, 2023 · 2 comments

Comments

@kwavnet
Copy link

kwavnet commented Jun 15, 2023

Subject of the issue

#855 explains that it is hard to handle situations where one would hit
You have exceeded a secondary rate limit and have been temporarily blocked from content creation. Please retry your request again later. and I agree with the result of the discussion.
But what would be really nice to have is a printout of the received Retry-After header content in the log message.

For now I will have to retry after a random time potentially hitting the same rate limits again and again.
And additional display of the received header would make sure that I won't try before backoff period really expired.

@peter-evans
Copy link
Owner

Hi @kwavnet

I'm not sure how easy it would be for me to extract that information. I'm using Octokit to handle API requests, so it depends if I can tap into that information somehow. I'll try to check if it's possible.

I'm also not sure if there even is a Retry-After header when hitting secondary rate limits. I would not be surprised if there isn't, because they want clients to back-off for a long time before retrying. Retry-After is normally used for scenarios where they just want you to slow down by seconds.

@kwavnet
Copy link
Author

kwavnet commented Jun 16, 2023

From what I see there is https://github.com/octokit/octokit.js/blob/55564cd3f7c0f6d429852e8dddf5dc01e6294f80/src/octokit.ts#L36 - giving the needed information - not sure if that can be overridden by a custom handler

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

No branches or pull requests

2 participants