gr2m / helpdesk

Answering all your GitHub API/automation questions live on Twitch
https://twitch.tv/gregorcodes
Creative Commons Zero v1.0 Universal
22 stars 11 forks source link

Retry requests for server 403 responses #62

Closed gfarb closed 2 years ago

gfarb commented 2 years ago

Please avoid duplicates

Description

Additional rate limits apply to some actions when using the GitHub REST API (i,e. creating issue comments). When the secondary rate limits are exceeded, the server responds with a 403 status code and a message stating, You have exceeded a secondary rate limit and have been temporarily blocked from content creation. Please retry your request again later.

According to docs:

"When you have been limited, use the Retry-After response header to slow down. The value of the Retry-After header will always be an integer, representing the number of seconds you should wait before making requests again. For example, Retry-After: 30 means you should wait 30 seconds before sending more requests."

It would be great if plugin-retry.js also retried requests when this specific response is returned so we do not have to set the Retry-After header and can keep code more consistent.

Would you be interested in joining the show?

gr2m commented 2 years ago

secondary rate limits should be covered by https://github.com/octokit/plugin-throttling.js

I don't feel like this is more a support question, it's too specific to be useful as a show. Best to ask in the @octokit repositories