fix(releases): add required octokit throttling rate limit handlers
When throttle is enabled in Octokit, the plugin requires onRateLimit and onSecondaryRateLimit handlers. Without them, the releases widget crashes with an error when fetching GitHub/DockerHub release data. Fixes #6309
This commit is contained in:
1 parent
5fa3a3313a
commit
c01fd723ee
1 file changed
+15
-1
@@ -134,7 +134,21 @@ const getGithubApi = (baseUrl: string, userAgent: string, token?: string) =>
|
||||
baseUrl,
|
||||
auth: token,
|
||||
request: { fetch: fetchWithTrustedCertificatesAsync },
|
||||
throttle: { enabled: true },
|
||||
throttle: {
|
||||
enabled: true,
|
||||
onRateLimit: (retryAfter: number, options: { url?: string; method?: string }) => {
|
||||
logger.warn(`GitHub rate limit exceeded, retrying after ${retryAfter}s`, {
|
||||
url: options.url,
|
||||
method: options.method,
|
||||
});
|
||||
},
|
||||
onSecondaryRateLimit: (retryAfter: number, options: { url?: string; method?: string }) => {
|
||||
logger.warn(`GitHub secondary rate limit exceeded, retrying after ${retryAfter}s`, {
|
||||
url: options.url,
|
||||
method: options.method,
|
||||
});
|
||||
},
|
||||
},
|
||||
userAgent,
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user