From 20292a210239918ffcbda1fc82a294dd0d999e4f Mon Sep 17 00:00:00 2001 From: Stefan Penner Date: Thu, 24 Jun 2021 11:31:13 -0600 Subject: [PATCH] [BREAKING] Respect JOBS count if present For web-pack: JOBS=0 uses the current thread of execution JOBS=1..n spawns the corresponding thread or sub-processes No set JOBS results in a dynamically calculated number of jobs Previously JOBS=1 used the current thread of execution All other variations would dynamically calculated number of jobs --- packages/webpack/src/ember-webpack.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/webpack/src/ember-webpack.ts b/packages/webpack/src/ember-webpack.ts index 7dc1d3caad..5d2ea87a87 100644 --- a/packages/webpack/src/ember-webpack.ts +++ b/packages/webpack/src/ember-webpack.ts @@ -522,6 +522,7 @@ const Webpack: PackagerConstructor = class Webpack implements Packager }; const threadLoaderOptions = { + workers: 'JOBS' in process.env && Number(process.env.JOBS), // poolTimeout shuts down idle workers. The problem is, for // interactive rebuilds that means your startup cost for the // next rebuild is at least 600ms worse. So we insist on @@ -545,7 +546,7 @@ function warmUp(extraOptions: object | false | undefined) { } function maybeThreadLoader(isParallelSafe: boolean, extraOptions: object | false | undefined) { - if (process.env.JOBS === '1' || extraOptions === false || !isParallelSafe) { + if (process.env.JOBS === '0' || extraOptions === false || !isParallelSafe) { return null; }