mirror of
https://github.com/github/codeql-action.git
synced 2025-12-31 03:30:14 +08: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:
@@ -453,7 +453,10 @@ function getCgroupCpuCountFromCpus(
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user