mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-06-28 22:26:02 +00:00
node_modules
This commit is contained in:
parent
5e3f23f92c
commit
806116bda4
734 changed files with 224451 additions and 0 deletions
18
node_modules/@octokit/plugin-retry/dist-src/wrap-request.js
generated
vendored
Normal file
18
node_modules/@octokit/plugin-retry/dist-src/wrap-request.js
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
// @ts-ignore
|
||||
import Bottleneck from "bottleneck/light";
|
||||
// @ts-ignore
|
||||
export 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue