-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Client.RateLimits shouldn't return RateLimitError #1899
Comments
May I please ask what the actual problem is that you are trying to solve? In other words, why is it a problem that |
|
I suppose a third option is to modify |
Thanks for your feedback. Exactly, and I think we have at least 2 ways of implementing such bypass mechanism (the 2 options I previously listed). Do not hesitate to provide any guidance to take a decision. |
My current thought is to not add to the complexity of I'm fine for you to go ahead and create a PR if you are interested, @sa-spag, and let's see what it looks like. |
👋 Hello,
I noticed that
Client.RateLimits
can return aRateLimitError
, as per:go-github/github/github.go
Lines 648 to 652 in 75644ea
According to GitHub REST API documentation, rate limit status can be checked "at any time using the Rate Limit API", i.e. even when the remaining number of allowed requests is 0, and the
GET /rate_limit
endpoint never responds with a HTTP 403. I verified myself and I can confirm the documentation is accurate. Therefore, I thinkClient.RateLimits
should never returnRateLimitError
errors and return the actual rate limit status, by performing a HTTP request.I have 2 solutions in mind:
Client.checkRateLimitBeforeDo
is aware of some allowlist of endpoints, includingGET /rate_limits
(and perhaps others I don't know yet about), for which it should always returnnil
;Happy to discuss any solution before I (or someone else) patch(es) the issue. Thanks!
The text was updated successfully, but these errors were encountered: