Skip to content

Commit

Permalink
fix(core): cap inferred max workers count at 8 (#14366)
Browse files Browse the repository at this point in the history
(cherry picked from commit ab8197c)
  • Loading branch information
FrozenPandaz committed Jan 17, 2023
1 parent d685763 commit 30024d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nx/src/project-graph/build-project-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function buildExplicitDependenciesUsingWorkers(
function getNumberOfWorkers(): number {
return process.env.NX_PROJECT_GRAPH_MAX_WORKERS
? +process.env.NX_PROJECT_GRAPH_MAX_WORKERS
: os.cpus().length - 1;
: Math.min(os.cpus().length - 1, 8); // This is capped for cases in CI where `os.cpus()` returns way more CPUs than the resources that are allocated
}

function createContext(
Expand Down

0 comments on commit 30024d2

Please sign in to comment.