Skip to content

Commit

Permalink
fix: retry more with GitHubs own 'retry after' values (#800)
Browse files Browse the repository at this point in the history
## What
Retry more times while adhering to the `retry after` values the GitHub
API provide us with.
  • Loading branch information
jumoel authored Mar 14, 2024
1 parent b2f3427 commit dee5be0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions workspaces/data/lib/api/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ module.exports = ({ auth }) => {
`Request quota exhausted for request ${options.method} ${options.url}`
)

if (options.request.retryCount === 0) {
// only retries once
if (options.request.retryCount < 5) {
octokit.log.info(`Retrying after ${retryAfter} seconds!`)
return true
}
Expand All @@ -33,8 +32,7 @@ module.exports = ({ auth }) => {
`SecondaryRateLimit detected for request ${options.method} ${options.url}`
)

if (options.request.retryCount === 0) {
// only retries once
if (options.request.retryCount < 5) {
octokit.log.info(`Retrying after ${retryAfter} seconds!`)
return true
}
Expand Down

0 comments on commit dee5be0

Please sign in to comment.