-
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
feat: Add an option to wait for primary rate limit reset and retry instead of erroring out #3114
Comments
What did you think of my earlier suggestion? |
That would work great for us |
OK, cool. Would you like to submit a PR, @erezrokah , or would you prefer that I open this up to our other contributors? |
I can open a PR if you point me to the right direction. Is the suggestion a new pattern to the repo or an existing pattern there's a reference for? |
I believe this would be new functionality. As such, I have not explored the solution space. |
I'm ok with that no worries, wanted to make sure I'm not missing anything. I'll take a look and reach out if I'm blocked |
Opened a PR #3117, feedback welcomed |
Hi 👋 🐰
This is mostly the same issue as #1920
For our use case we'd prefer to wait until the reset time instead of erroring out when the primary rate limit is reached.
The only way I found to do it at the moment is wrap each API call with a check to
github.RateLimitError
.We can't use
roundtripper
ascheckRateLimitBeforeDo
happens before. I tried wrappingBareDo
with my own implementation but couldn't get it to work due to how the services and client are initialized.If
bypassRateLimitCheck
was exported I might have been able to use it to bypass the check and get use aroundtripper
but that doesn't seem very elegant.Can you suggestion a solution?
The text was updated successfully, but these errors were encountered: