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
This commit is contained in:
Pete Bacon Darwin 2020-03-28 16:57:49 +00:00 committed by Alex Rickabaugh
parent bc089abd32
commit 5ac308060d
1 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ export class ClusterMaster {
private onTaskCompleted: TaskCompletedCallback; private onTaskCompleted: TaskCompletedCallback;
constructor( constructor(
private workerCount: number, private logger: Logger, private maxWorkerCount: number, private logger: Logger,
private pkgJsonUpdater: PackageJsonUpdater, analyzeEntryPoints: AnalyzeEntryPointsFn, private pkgJsonUpdater: PackageJsonUpdater, analyzeEntryPoints: AnalyzeEntryPointsFn,
createTaskCompletedCallback: CreateTaskCompletedCallback) { createTaskCompletedCallback: CreateTaskCompletedCallback) {
if (!cluster.isMaster) { if (!cluster.isMaster) {
@ -106,7 +106,7 @@ export class ClusterMaster {
if (!isWorkerAvailable) { if (!isWorkerAvailable) {
const spawnedWorkerCount = Object.keys(cluster.workers).length; 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.'); this.logger.debug('Spawning another worker process as there is more work to be done.');
cluster.fork(); cluster.fork();
} else { } else {