fix(core): build-project-graph shouldn't fail when large number of workers are available (#9804)
fixes #9801
This commit is contained in:
parent
4b846e8dc9
commit
1857138e74
@ -49,7 +49,6 @@ export async function buildProjectGraph() {
|
|||||||
|
|
||||||
const cacheEnabled = process.env.NX_CACHE_PROJECT_GRAPH !== 'false';
|
const cacheEnabled = process.env.NX_CACHE_PROJECT_GRAPH !== 'false';
|
||||||
let cache = cacheEnabled ? readCache() : null;
|
let cache = cacheEnabled ? readCache() : null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
await buildProjectGraphUsingProjectFileMap(
|
await buildProjectGraphUsingProjectFileMap(
|
||||||
workspaceJson,
|
workspaceJson,
|
||||||
@ -292,7 +291,10 @@ function buildExplicitDependenciesUsingWorkers(
|
|||||||
totalNumOfFilesToProcess: number,
|
totalNumOfFilesToProcess: number,
|
||||||
builder: ProjectGraphBuilder
|
builder: ProjectGraphBuilder
|
||||||
) {
|
) {
|
||||||
const numberOfWorkers = getNumberOfWorkers();
|
const numberOfWorkers = Math.min(
|
||||||
|
totalNumOfFilesToProcess,
|
||||||
|
getNumberOfWorkers()
|
||||||
|
);
|
||||||
const bins = splitFilesIntoBins(
|
const bins = splitFilesIntoBins(
|
||||||
ctx,
|
ctx,
|
||||||
totalNumOfFilesToProcess,
|
totalNumOfFilesToProcess,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user