Skip to content

Commit

Permalink
Cumulative update of dependencies (#987)
Browse files Browse the repository at this point in the history
* Update deps

* Update licenses
  • Loading branch information
IvanZosimov committed Apr 12, 2023
1 parent 72afbce commit 03af7c3
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 352 deletions.
2 changes: 1 addition & 1 deletion .licenses/npm/@octokit/plugin-retry.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 9 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7405,7 +7405,7 @@ var Bottleneck = _interopDefault(__nccwpck_require__(1174));
var requestError = __nccwpck_require__(537);

// @ts-ignore
async function errorRequest(octokit, state, error, options) {
async function errorRequest(state, octokit, error, options) {
if (!error.request || !error.request.request) {
// address https://github.com/octokit/plugin-retry.js/issues/8
throw error;
Expand All @@ -7420,11 +7420,9 @@ async function errorRequest(octokit, state, error, options) {
throw error;
}

// @ts-ignore
// @ts-ignore
async function wrapRequest(state, request, options) {
// @ts-nocheck
async function wrapRequest(state, octokit, 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;
Expand All @@ -7435,23 +7433,22 @@ async function wrapRequest(state, request, options) {
return after * state.retryAfterBaseValue;
}
});
return limiter.schedule(requestWithGraphqlErrorHandling.bind(null, request), options);
return limiter.schedule(requestWithGraphqlErrorHandling.bind(null, state, octokit, request), options);
}
// @ts-ignore
async function requestWithGraphqlErrorHandling(request, options) {
async function requestWithGraphqlErrorHandling(state, octokit, request, options) {
const response = await request(request, options);
if (response.data && response.data.errors && /Something went wrong while executing your query/.test(response.data.errors[0].message)) {
// simulate 500 request error for retry handling
const error = new requestError.RequestError(response.data.errors[0].message, 500, {
request: options,
response
});
throw error;
return errorRequest(state, octokit, error, options);
}
return response;
}

const VERSION = "4.1.1";
const VERSION = "4.1.3";
function retry(octokit, octokitOptions) {
const state = Object.assign({
enabled: true,
Expand All @@ -7460,8 +7457,8 @@ function retry(octokit, octokitOptions) {
retries: 3
}, octokitOptions.retry);
if (state.enabled) {
octokit.hook.error("request", errorRequest.bind(null, octokit, state));
octokit.hook.wrap("request", wrapRequest.bind(null, state));
octokit.hook.error("request", errorRequest.bind(null, state, octokit));
octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit));
}
return {
retry: {
Expand Down
Loading

1 comment on commit 03af7c3

@tuckstarrydell
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.