initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
18
github/codeql-action-v1/node_modules/@octokit/plugin-retry/dist-src/wrap-request.js
generated
vendored
Normal file
18
github/codeql-action-v1/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