Skip to content

Commit

Permalink
Build Tooling: Define build concurrency explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed May 20, 2019
1 parent 5dd7e90 commit 4338f9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ branches:
before_install:
- nvm install

env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
env:
- PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
- HARDWARE_CONCURRENCY=2

jobs:
include:
Expand Down
10 changes: 9 additions & 1 deletion bin/packages/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ if ( ! files.length ) {
};
}

const worker = workerFarm( require.resolve( './build-worker' ) );
const options = {};
if ( process.env.HARDWARE_CONCURRENCY ) {
// WorkerFarm is configured to use the number of CPUs available as the
// default value. This can be overwritten for finite control or for use in
// uncooperative continuous integration.
options.maxConcurrentWorkers = Number( process.env.HARDWARE_CONCURRENCY );
}

const worker = workerFarm( options, require.resolve( './build-worker' ) );

let complete = 0;

Expand Down

0 comments on commit 4338f9e

Please sign in to comment.