From 406e37cf5a91a1785e507f8fb34a64fbf3bdb923 Mon Sep 17 00:00:00 2001 From: kty1965 Date: Wed, 14 Feb 2024 23:30:03 +0900 Subject: [PATCH] fix: add onSecondaryRateLimit to octokit --- dist/index.js | 7 ++++++- src/github.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 095f0bd..d5d4a9b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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}` diff --git a/src/github.js b/src/github.js index 5d19462..b56a701 100644 --- a/src/github.js +++ b/src/github.js @@ -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}`