Skip to content

Commit

Permalink
fix: add onSecondaryRateLimit to octokit
Browse files Browse the repository at this point in the history
  • Loading branch information
kty1965 committed Feb 14, 2024
1 parent 77a4437 commit 406e37c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30644,7 +30644,12 @@ const CreateGithubClient = (token, maxRetries = 3) => {
return true;
}
},

onSecondaryRateLimit: (retryAfter, options, octokit) => {
// does not retry, only logs a warning
octokit.log.warn(
`SecondaryRateLimit detected for request ${options.method} ${options.url}`
);
},
onAbuseLimit: (retryAfter, options) => {
octokit.log.warn(
`Abuse detection triggered request ${options.method} ${options.url}`
Expand Down
7 changes: 6 additions & 1 deletion src/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ export const CreateGithubClient = (token, maxRetries = 3) => {
return true;
}
},

onSecondaryRateLimit: (retryAfter, options, octokit) => {
// does not retry, only logs a warning
octokit.log.warn(
`SecondaryRateLimit detected for request ${options.method} ${options.url}`
);
},
onAbuseLimit: (retryAfter, options) => {
octokit.log.warn(
`Abuse detection triggered request ${options.method} ${options.url}`
Expand Down

0 comments on commit 406e37c

Please sign in to comment.