Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2023-01-23 17:26:40 +00:00
parent 78f2db88fc
commit 45eb0a66d5
32 changed files with 77161 additions and 5865 deletions

View file

@ -11,29 +11,26 @@ async function errorRequest(octokit, state, error, options) {
if (!error.request || !error.request.request) {
// address https://github.com/octokit/plugin-retry.js/issues/8
throw error;
} // retry all >= 400 && not doNotRetry
}
// retry all >= 400 && not doNotRetry
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
const retries = options.request.retries != null ? options.request.retries : state.retries;
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
throw octokit.retry.retryRequest(error, retries, retryAfter);
} // Maybe eventually there will be more cases here
}
// Maybe eventually there will be more cases here
throw error;
}
// @ts-ignore
// @ts-ignore
async function wrapRequest(state, request, options) {
const limiter = new Bottleneck(); // @ts-ignore
const limiter = new Bottleneck();
// @ts-ignore
limiter.on("failed", function (error, info) {
const maxRetries = ~~error.request.request.retries;
const after = ~~error.request.request.retryAfter;
options.request.retryCount = info.retryCount + 1;
if (maxRetries > info.retryCount) {
// Returning a number instructs the limiter to retry
// the request after that number of milliseconds have passed
@ -43,7 +40,7 @@ async function wrapRequest(state, request, options) {
return limiter.schedule(request, options);
}
const VERSION = "3.0.9";
const VERSION = "4.0.4";
function retry(octokit, octokitOptions) {
const state = Object.assign({
enabled: true,
@ -51,12 +48,10 @@ function retry(octokit, octokitOptions) {
doNotRetry: [400, 401, 403, 404, 422],
retries: 3
}, octokitOptions.retry);
if (state.enabled) {
octokit.hook.error("request", errorRequest.bind(null, octokit, state));
octokit.hook.wrap("request", wrapRequest.bind(null, state));
}
return {
retry: {
retryRequest: (error, retries, retryAfter) => {

File diff suppressed because one or more lines are too long