Move cache-related util functions into dedicated module

This commit is contained in:
Mario Campos
2026-08-11 13:39:19 -05:00
parent 4dc327a942
commit 1332611f51
8 changed files with 1104 additions and 1081 deletions

View File

@@ -12,6 +12,7 @@ import {
runTool,
} from "./actions-util";
import * as api from "./api-client";
import * as outputCache from "./cli/output-cache";
import { CliError, wrapCliConfigurationError } from "./cli-errors";
import { appendExtraQueryExclusions, type Config } from "./config-utils";
import { DocUrl } from "./doc-url";
@@ -502,7 +503,7 @@ async function getCodeQLForCmd(
return cmd;
},
async getVersion() {
let result = util.getCachedCodeQlVersion(cmd);
let result = outputCache.getCachedCodeQlVersion(cmd);
if (result === undefined) {
result = await runCliJson<VersionInfo>(
cmd,
@@ -511,7 +512,7 @@ async function getCodeQLForCmd(
noStreamStdout: true,
},
);
util.cacheCodeQlVersion(cmd, result);
outputCache.cacheCodeQlVersion(cmd, result);
}
return result;
},