mirror of
https://github.com/github/codeql-action.git
synced 2026-10-31 01:49:43 +00:00
Account for existing but empty cpus file
If a CPU file exists but is empty, previously we reported this file with a CPU count of 1, which resulted in a single-threaded run.
This commit is contained in:
5
lib/util.js
generated
5
lib/util.js
generated
@@ -316,7 +316,10 @@ function getCgroupCpuCountFromCpus(cpusFile, logger) {
|
||||
}
|
||||
let cpuCount = 0;
|
||||
// Comma-separated numbers and ranges, for eg. 0-1,3
|
||||
const cpusString = fs.readFileSync(cpusFile, "utf-8");
|
||||
const cpusString = fs.readFileSync(cpusFile, "utf-8").trim();
|
||||
if (cpusString.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
for (const token of cpusString.split(",")) {
|
||||
if (!token.includes("-")) {
|
||||
// Not a range
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user