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

Commit

Permalink
retry on secondary limits except when submitting batched review (#384)
Browse files Browse the repository at this point in the history
<!-- 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 -->
  • Loading branch information
harjotgill authored Jul 28, 2023
1 parent a116595 commit 7818adf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/octokit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ Retry count: ${retryCount}
warning(
`SecondaryRateLimit detected for request ${options.method} ${options.url} ; retry after ${retryAfter} seconds`
)
// if we are doing a POST method on /repos/{owner}/{repo}/pulls/{pull_number}/reviews then we shouldn't retry
if (
options.method === 'POST' &&
options.url.match(/\/repos\/.*\/.*\/pulls\/.*\/reviews/)
) {
return false
}
return true
}
}
})

0 comments on commit 7818adf

Please sign in to comment.