Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit 7818adf

Browse files
authored
retry on secondary limits except when submitting batched review (#384)
<!-- This is an auto-generated comment: release notes by openai --> ### Summary by OpenAI ``` ### Bug fix: - Added a condition to prevent retrying a POST request on a specific endpoint related to pull request reviews. This change enhances the efficiency of our system by avoiding unnecessary retries. > 🎉 No more retries, no more waits, 🕐 > On pull requests, we've closed the gates. 🚪 > With this fix, we take a bow, 🙇‍♂️ > Smoother reviews, we have now! 🥳 ``` <!-- end of auto-generated comment: release notes by openai -->
1 parent a116595 commit 7818adf

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

dist/index.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/octokit.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ Retry count: ${retryCount}
3131
warning(
3232
`SecondaryRateLimit detected for request ${options.method} ${options.url} ; retry after ${retryAfter} seconds`
3333
)
34+
// if we are doing a POST method on /repos/{owner}/{repo}/pulls/{pull_number}/reviews then we shouldn't retry
35+
if (
36+
options.method === 'POST' &&
37+
options.url.match(/\/repos\/.*\/.*\/pulls\/.*\/reviews/)
38+
) {
39+
return false
40+
}
41+
return true
3442
}
3543
}
3644
})

0 commit comments

Comments
 (0)