Skip to content

Commit

Permalink
Adjust throttling based on new deprecation notice
Browse files Browse the repository at this point in the history
  • Loading branch information
payne911 committed Nov 23, 2022
1 parent 1c6cef5 commit 739eba5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions website/src/queries-logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,17 @@ function setUpOctokitWithLatestToken() {
octokit = new MyOctokit({
auth: LOCAL_STORAGE_GITHUB_ACCESS_TOKEN,
userAgent: 'useful-forks',
// https://github.com/octokit/plugin-throttling.js#usage
throttle: {
onRateLimit: (retryAfter, options) => {
onRateLimit: (retryAfter, options, octokit, retryCount) => {
onRateLimitExceeded();
if (options.request.retryCount === 0) { // only retries once
if (retryCount < 1) { // only retries once
return true; // true = retry
}
},
onAbuseLimit: (retryAfter, options) => {
onSecondaryRateLimit: (retryAfter, options, octokit) => {
setMsg(UF_MSG_SLOWER);
return true; // true = automatically retry after given amount of seconds
return true; // true = automatically retry after given amount of seconds (usually 60)
}
}
});
Expand Down

0 comments on commit 739eba5

Please sign in to comment.