Closed jporzucek closed 1 year ago
I think this is a bit more or a problem than just this PR handles.
We have just today seen the message from github become
You have exceeded a secondary rate limit and have been temporarily blocked from content creation. Please retry your request again later. If you reach out to GitHub Support for help, please include the request ID <unique id>.
Is there a better way of dealing with this that is more resilient to the message changing?
Thanks for your comments! I added the message check because of conflicts with the primary rate limit. I tried to follow the API docs but I guess it's too dynamic.
It seems like all the messages start with the same sentence though, so checking for HasPrefix() should work.
I'm on vacation and not gonna have PC access for a few weeks, so please feel free to implement it if it sounds good to you and I'll approve it from my phone.
p.s. @jporzucek sorry for not getting to that earlier, I just missed it
Hey both. I just opened https://github.com/gofri/go-github-ratelimit/pull/16 I had implemented it before you responded @gofri happy for you to use it or not. It just worked for me on our internal tests.
Perfect!
Merged 😄 Thank you both for your contribution!
At the moment Secondary Rate Limit detector checks for single message only which apparently corresponds do POST API requests (content creation). When one hits Secondary Rate Limiter with GET request, the following message is returned by the API:
You have exceeded a secondary rate limit. Please wait a few minutes before you try again.