updating dist
This commit is contained in:
+93
-14
@@ -12273,29 +12273,26 @@ async function errorRequest(octokit, state, error, options) {
|
|||||||
if (!error.request || !error.request.request) {
|
if (!error.request || !error.request.request) {
|
||||||
// address https://github.com/octokit/plugin-retry.js/issues/8
|
// address https://github.com/octokit/plugin-retry.js/issues/8
|
||||||
throw error;
|
throw error;
|
||||||
} // retry all >= 400 && not doNotRetry
|
}
|
||||||
|
// retry all >= 400 && not doNotRetry
|
||||||
|
|
||||||
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
|
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
|
||||||
const retries = options.request.retries != null ? options.request.retries : state.retries;
|
const retries = options.request.retries != null ? options.request.retries : state.retries;
|
||||||
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
|
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
|
||||||
throw octokit.retry.retryRequest(error, retries, retryAfter);
|
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;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
// @ts-ignore
|
||||||
async function wrapRequest(state, request, options) {
|
async function wrapRequest(state, request, options) {
|
||||||
const limiter = new Bottleneck(); // @ts-ignore
|
const limiter = new Bottleneck();
|
||||||
|
// @ts-ignore
|
||||||
limiter.on("failed", function (error, info) {
|
limiter.on("failed", function (error, info) {
|
||||||
const maxRetries = ~~error.request.request.retries;
|
const maxRetries = ~~error.request.request.retries;
|
||||||
const after = ~~error.request.request.retryAfter;
|
const after = ~~error.request.request.retryAfter;
|
||||||
options.request.retryCount = info.retryCount + 1;
|
options.request.retryCount = info.retryCount + 1;
|
||||||
|
|
||||||
if (maxRetries > info.retryCount) {
|
if (maxRetries > info.retryCount) {
|
||||||
// Returning a number instructs the limiter to retry
|
// Returning a number instructs the limiter to retry
|
||||||
// the request after that number of milliseconds have passed
|
// the request after that number of milliseconds have passed
|
||||||
@@ -12305,7 +12302,7 @@ async function wrapRequest(state, request, options) {
|
|||||||
return limiter.schedule(request, options);
|
return limiter.schedule(request, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
const VERSION = "3.0.9";
|
const VERSION = "4.0.3";
|
||||||
function retry(octokit, octokitOptions) {
|
function retry(octokit, octokitOptions) {
|
||||||
const state = Object.assign({
|
const state = Object.assign({
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@@ -12313,12 +12310,10 @@ function retry(octokit, octokitOptions) {
|
|||||||
doNotRetry: [400, 401, 403, 404, 422],
|
doNotRetry: [400, 401, 403, 404, 422],
|
||||||
retries: 3
|
retries: 3
|
||||||
}, octokitOptions.retry);
|
}, octokitOptions.retry);
|
||||||
|
|
||||||
if (state.enabled) {
|
if (state.enabled) {
|
||||||
octokit.hook.error("request", errorRequest.bind(null, octokit, state));
|
octokit.hook.error("request", errorRequest.bind(null, octokit, state));
|
||||||
octokit.hook.wrap("request", wrapRequest.bind(null, state));
|
octokit.hook.wrap("request", wrapRequest.bind(null, state));
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
retry: {
|
retry: {
|
||||||
retryRequest: (error, retries, retryAfter) => {
|
retryRequest: (error, retries, retryAfter) => {
|
||||||
@@ -24159,7 +24154,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|||||||
var core = __nccwpck_require__(8267);
|
var core = __nccwpck_require__(8267);
|
||||||
var pluginPaginateRest = __nccwpck_require__(3932);
|
var pluginPaginateRest = __nccwpck_require__(3932);
|
||||||
var pluginRestEndpointMethods = __nccwpck_require__(3779);
|
var pluginRestEndpointMethods = __nccwpck_require__(3779);
|
||||||
var pluginRetry = __nccwpck_require__(6298);
|
var pluginRetry = __nccwpck_require__(8519);
|
||||||
var pluginThrottling = __nccwpck_require__(2506);
|
var pluginThrottling = __nccwpck_require__(2506);
|
||||||
var app = __nccwpck_require__(4389);
|
var app = __nccwpck_require__(4389);
|
||||||
var oauthApp = __nccwpck_require__(3493);
|
var oauthApp = __nccwpck_require__(3493);
|
||||||
@@ -26187,6 +26182,90 @@ exports.restEndpointMethods = restEndpointMethods;
|
|||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 8519:
|
||||||
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
|
||||||
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||||
|
|
||||||
|
var Bottleneck = _interopDefault(__nccwpck_require__(1174));
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
|
||||||
|
async function wrapRequest(state, request, options) {
|
||||||
|
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
|
||||||
|
return after * state.retryAfterBaseValue;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return limiter.schedule(request, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
const VERSION = "3.0.9";
|
||||||
|
function retry(octokit, octokitOptions) {
|
||||||
|
const state = Object.assign({
|
||||||
|
enabled: true,
|
||||||
|
retryAfterBaseValue: 1000,
|
||||||
|
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) => {
|
||||||
|
error.request.request = Object.assign({}, error.request.request, {
|
||||||
|
retries: retries,
|
||||||
|
retryAfter: retryAfter
|
||||||
|
});
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
retry.VERSION = VERSION;
|
||||||
|
|
||||||
|
exports.VERSION = VERSION;
|
||||||
|
exports.retry = retry;
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 2506:
|
/***/ 2506:
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user