Add the --threads config option to finalize db (#281)
This flag is already being used for `runQueries`, so let's use it for finalize as well.
This commit is contained in:
parent
a6c99e6b5b
commit
bc1ee1620f
6 changed files with 14 additions and 10 deletions
|
|
@ -122,6 +122,7 @@ async function createdDBForScannedLanguages(
|
|||
|
||||
async function finalizeDatabaseCreation(
|
||||
config: configUtils.Config,
|
||||
threadsFlag: string,
|
||||
logger: Logger
|
||||
) {
|
||||
await createdDBForScannedLanguages(config, logger);
|
||||
|
|
@ -130,7 +131,8 @@ async function finalizeDatabaseCreation(
|
|||
for (const language of config.languages) {
|
||||
logger.startGroup(`Finalizing ${language}`);
|
||||
await codeql.finalizeDatabase(
|
||||
util.getCodeQLDatabasePath(config.tempDir, language)
|
||||
util.getCodeQLDatabasePath(config.tempDir, language),
|
||||
threadsFlag
|
||||
);
|
||||
logger.endGroup();
|
||||
}
|
||||
|
|
@ -239,7 +241,7 @@ export async function runAnalyze(
|
|||
fs.mkdirSync(outputDir, { recursive: true });
|
||||
|
||||
logger.info("Finalizing database creation");
|
||||
await finalizeDatabaseCreation(config, logger);
|
||||
await finalizeDatabaseCreation(config, threadsFlag, logger);
|
||||
|
||||
logger.info("Analyzing database");
|
||||
const queriesStats = await runQueries(
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ export interface CodeQL {
|
|||
/**
|
||||
* Finalize a database using 'codeql database finalize'.
|
||||
*/
|
||||
finalizeDatabase(databasePath: string): Promise<void>;
|
||||
finalizeDatabase(databasePath: string, threadsFlag: string): Promise<void>;
|
||||
/**
|
||||
* Run 'codeql resolve queries'.
|
||||
*/
|
||||
|
|
@ -561,12 +561,13 @@ function getCodeQLForCmd(cmd: string): CodeQL {
|
|||
errorMatchers
|
||||
);
|
||||
},
|
||||
async finalizeDatabase(databasePath: string) {
|
||||
async finalizeDatabase(databasePath: string, threadsFlag: string) {
|
||||
await toolrunnerErrorCatcher(
|
||||
cmd,
|
||||
[
|
||||
"database",
|
||||
"finalize",
|
||||
threadsFlag,
|
||||
...getExtraOptionsFromEnv(["database", "finalize"]),
|
||||
databasePath,
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue