-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
[Feature Request] Is it possible to use Throttling to gracefully handle issues with API limits? #241
Comments
Hi @kunaltyagi If you are hitting rate-limits it's likely to be the secondary limits for resource creation. There is a thread about rate-limiting related to GitHub actions and a summary here: peter-evans/create-pull-request#855 (comment) The short version is that it's not really feasible to handle secondary rate-limits well in actions. The best advice is to redesign your workflows to avoid hitting the limits. |
I do understand the need to redesign the workflow based on the details. Would it be possible to add an option for a pre-comment delay? If we set that to 1 second, it would also achieve the same as suggested by the recommendation. I could wrap your action inside another, but that would be a lot of work for just a 1 second sleep |
When you hit secondary rate-limits they aren't like "normal" rate-limits where you can just wait a second or two. That's why throttling in the action code doesn't work. GitHub actually blocks resource creation for a significant period of time, like minutes. It's not feasible or desirable for the action to wait for large periods of time. That's why the advice is to redesign and make sure you avoid hitting the secondary rate-limits for resource creation. |
Based on this extract from your comment, if we have 1 second between requests, this would resolve the fact that we are hitting secondary rate-limits. Maybe my understanding is wrong... |
It most likely will not resolve it because the API you are being rate-limited on for this action is creating resources.
These are the rate-limits that I'm talking about. I don't want to start another long thread going back and forth about this whole issue again. Please read the thread I linked carefully. You can redesign your workflow to avoid it, or perhaps use multiple PATs from different user accounts. |
Then we can use this returned
octokit
transparently instead to handle API limits caused by factors unknown to the action:The text was updated successfully, but these errors were encountered: