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:
parent
65b0987dbe
commit
ef0a773901
4 changed files with 10 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue