Skip to content

Commit 739eba5

Browse files
committed
Adjust throttling based on new deprecation notice
1 parent 1c6cef5 commit 739eba5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

website/src/queries-logic.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,17 @@ function setUpOctokitWithLatestToken() {
330330
octokit = new MyOctokit({
331331
auth: LOCAL_STORAGE_GITHUB_ACCESS_TOKEN,
332332
userAgent: 'useful-forks',
333+
// https://github.com/octokit/plugin-throttling.js#usage
333334
throttle: {
334-
onRateLimit: (retryAfter, options) => {
335+
onRateLimit: (retryAfter, options, octokit, retryCount) => {
335336
onRateLimitExceeded();
336-
if (options.request.retryCount === 0) { // only retries once
337+
if (retryCount < 1) { // only retries once
337338
return true; // true = retry
338339
}
339340
},
340-
onAbuseLimit: (retryAfter, options) => {
341+
onSecondaryRateLimit: (retryAfter, options, octokit) => {
341342
setMsg(UF_MSG_SLOWER);
342-
return true; // true = automatically retry after given amount of seconds
343+
return true; // true = automatically retry after given amount of seconds (usually 60)
343344
}
344345
}
345346
});

0 commit comments

Comments
 (0)