-
Notifications
You must be signed in to change notification settings - Fork 12
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
Callback function doesn't trigger after secondary rate limit is hit #9
Comments
I set some break points and found that despite a 403 error being returned, with the "You have exceeded a secondary rate limit" error message, there is no Would it be possible for go-github-ratelimit to also check |
Hey @johnmcollier, thanks for the detailed report! It would also be useful to have the full set of response headers; x-ratelimit-reset is used for the primary rate limit too, which is categorized. Treating primary rate limit the same as a secondary may prevent users from using all API endpoints, when some endpoints are still available. |
Hey @gofri sure thing. Thanks for the prompt response! I'm hitting the secondary rate limiting on repository creation. It's on GitHub.com, specifically the https://api.github.com/user/repos endpoint. And I've printed the full list of headers:
|
Thanks @johnmcollier! Looks like a legit secondary rate limit indeed. Just to be sure, the response body has the message as described in the documentation, right? p.s. I noticed in your comment the undocumented x-ratelimit-reaource header there. Looks like it'd be very useful for implementing primary rate limit handling in a simple and hermetic way. Thanks for that 💪 |
Yup, I can confirm I get the following message in the body:
|
Cool! PRs are always welcome. 😂 |
@gmlewis duly noted 😅 @johnmcollier |
It works, thanks a ton! Looking forward to seeing it in main 😃 |
Hi,
I have some code that intiializes a go-github client using
go-github-ratelimiter
, with a custom callback function defined like so:But despite using a GitHub token that is secondary rate limited (for content creation), I don't ever see the callback function run.
I'm using github.com/gofri/go-github-ratelimit v1.0.2 and github.com/google/go-github/v41 v41.0.0
The text was updated successfully, but these errors were encountered: