From 5ac308060d781b68d5c2018701a01c57ed8928d8 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Sat, 28 Mar 2020 16:57:49 +0000 Subject: [PATCH] refactor(ngcc): rename `workerCount` to `maxWorkerCount` (#36298) Now that we spawn workers lazily as needed, this private property is really the upper limit on how many workers we might spawn. PR Close #36298 --- packages/compiler-cli/ngcc/src/execution/cluster/master.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/compiler-cli/ngcc/src/execution/cluster/master.ts b/packages/compiler-cli/ngcc/src/execution/cluster/master.ts index 6de28f0d73..9976b4b327 100644 --- a/packages/compiler-cli/ngcc/src/execution/cluster/master.ts +++ b/packages/compiler-cli/ngcc/src/execution/cluster/master.ts @@ -33,7 +33,7 @@ export class ClusterMaster { private onTaskCompleted: TaskCompletedCallback; constructor( - private workerCount: number, private logger: Logger, + private maxWorkerCount: number, private logger: Logger, private pkgJsonUpdater: PackageJsonUpdater, analyzeEntryPoints: AnalyzeEntryPointsFn, createTaskCompletedCallback: CreateTaskCompletedCallback) { if (!cluster.isMaster) { @@ -106,7 +106,7 @@ export class ClusterMaster { if (!isWorkerAvailable) { const spawnedWorkerCount = Object.keys(cluster.workers).length; - if (spawnedWorkerCount < this.workerCount) { + if (spawnedWorkerCount < this.maxWorkerCount) { this.logger.debug('Spawning another worker process as there is more work to be done.'); cluster.fork(); } else {