File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments