diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2017-08-15 01:05:29 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-08-18 22:42:23 +0300 |
commit | 867df2b0214689822b87b51578e347f353be97e8 (patch) | |
tree | 1af0a3eef397d0f4ed71b2933d504048d8b99c47 /lib | |
parent | cecd6aa5d4dd04af765b26b749c1cd032f7eb913 (diff) |
extract: only do multiple procs on OSX for now
Credit: @zkat
Reviewed-By: @iarna
PR-URL: https://github.com/npm/npm/pull/18164
Diffstat (limited to 'lib')
-rw-r--r-- | lib/install/action/extract.js | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/lib/install/action/extract.js b/lib/install/action/extract.js index 5534e8b28..8e80d4add 100644 --- a/lib/install/action/extract.js +++ b/lib/install/action/extract.js @@ -20,16 +20,34 @@ const workerFarm = require('worker-farm') const WORKER_PATH = require.resolve('./extract-worker.js') let workers +// NOTE: temporarily disabled on non-OSX due to ongoing issues: +// +// * Seems to make Windows antivirus issues much more common +// * Messes with Docker (I think) +// +// There are other issues that should be fixed that affect OSX too: +// +// * Logging is messed up right now because pacote does its own thing +// * Global deduplication in pacote breaks due to multiple procs +// +// As these get fixed, we can start experimenting with re-enabling it +// at least on some platforms. +const ENABLE_WORKERS = process.platform === 'darwin' + extract.init = () => { - workers = workerFarm({ - maxConcurrentCallsPerWorker: npm.limit.fetch, - maxRetries: 1 - }, WORKER_PATH) + if (ENABLE_WORKERS) { + workers = workerFarm({ + maxConcurrentCallsPerWorker: npm.limit.fetch, + maxRetries: 1 + }, WORKER_PATH) + } return BB.resolve() } extract.teardown = () => { - workerFarm.end(workers) - workers = null + if (ENABLE_WORKERS) { + workerFarm.end(workers) + workers = null + } return BB.resolve() } module.exports = extract @@ -54,7 +72,7 @@ function extract (staging, pkg, log) { let msg = args const spec = typeof args[0] === 'string' ? npa(args[0]) : args[0] args[0] = spec.raw - if (spec.registry || spec.type === 'remote') { + if (ENABLE_WORKERS && (spec.registry || spec.type === 'remote')) { // We can't serialize these options opts.loglevel = opts.log.level opts.log = null |