mirror of
https://github.com/github/codeql-action.git
synced 2026-11-17 02:01:30 +00:00
Configure the API client to retry more often when in test mode
This commit is contained in:
9
lib/start-proxy-action.js
generated
9
lib/start-proxy-action.js
generated
@@ -49321,6 +49321,9 @@ async function delay(milliseconds, opts) {
|
||||
}
|
||||
});
|
||||
}
|
||||
function isInTestMode() {
|
||||
return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true";
|
||||
}
|
||||
function getErrorMessage(error2) {
|
||||
return error2 instanceof Error ? error2.message : String(error2);
|
||||
}
|
||||
@@ -49370,6 +49373,9 @@ var core6 = __toESM(require_core());
|
||||
var githubUtils = __toESM(require_utils4());
|
||||
var retry = __toESM(require_dist_node15());
|
||||
var import_console_log_level = __toESM(require_console_log_level());
|
||||
function getRetryConfig() {
|
||||
return isInTestMode() ? { retries: 10 } : { retries: 3 };
|
||||
}
|
||||
function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) {
|
||||
const auth = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth;
|
||||
const retryingOctokit = githubUtils.GitHub.plugin(retry.retry);
|
||||
@@ -49377,7 +49383,8 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {})
|
||||
githubUtils.getOctokitOptions(auth, {
|
||||
baseUrl: apiDetails.apiURL,
|
||||
userAgent: `CodeQL-Action/${getActionVersion()}`,
|
||||
log: (0, import_console_log_level.default)({ level: "debug" })
|
||||
log: (0, import_console_log_level.default)({ level: "debug" }),
|
||||
retry: getRetryConfig()
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user