mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-06-28 14:16:02 +00:00
node_modules
This commit is contained in:
parent
5e3f23f92c
commit
806116bda4
734 changed files with 224451 additions and 0 deletions
26
node_modules/@octokit/plugin-retry/dist-src/index.js
generated
vendored
Normal file
26
node_modules/@octokit/plugin-retry/dist-src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { errorRequest } from "./error-request";
|
||||
import { wrapRequest } from "./wrap-request";
|
||||
export const VERSION = "0.0.0-development";
|
||||
export function retry(octokit, octokitOptions = {}) {
|
||||
const state = Object.assign({
|
||||
enabled: true,
|
||||
retryAfterBaseValue: 1000,
|
||||
doNotRetry: [400, 401, 403, 404, 422],
|
||||
retries: 3,
|
||||
}, octokitOptions.retry);
|
||||
octokit.retry = {
|
||||
retryRequest: (error, retries, retryAfter) => {
|
||||
error.request.request = Object.assign({}, error.request.request, {
|
||||
retries: retries,
|
||||
retryAfter: retryAfter,
|
||||
});
|
||||
return error;
|
||||
},
|
||||
};
|
||||
if (!state.enabled) {
|
||||
return;
|
||||
}
|
||||
octokit.hook.error("request", errorRequest.bind(null, octokit, state));
|
||||
octokit.hook.wrap("request", wrapRequest.bind(null, state));
|
||||
}
|
||||
retry.VERSION = VERSION;
|
Loading…
Add table
Add a link
Reference in a new issue