Update node options Initialization on our scripts (#40302) (#43358)

* chore(NA): update node options initilization on our scripts

* chore(NA): re-export NODE_OPTIONS instead of re-setting on vars

* chore(NA): missing doc comment
This commit is contained in:
Tiago Costa 2019-08-15 17:30:07 +01:00 committed by GitHub
parent f40aa17df6
commit 28fca42374
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 5 deletions

View file

@ -21,4 +21,4 @@ if [ ! -x "$NODE" ]; then
exit 1
fi
NODE_ENV=production exec "${NODE}" --no-warnings --max-http-header-size=65536 $NODE_OPTIONS "${DIR}/src/cli" ${@}
NODE_OPTIONS="--no-warnings --max-http-header-size=65536 ${NODE_OPTIONS}" NODE_ENV=production exec "${NODE}" "${DIR}/src/cli" ${@}

View file

@ -21,4 +21,4 @@ if [ ! -x "$NODE" ]; then
exit 1
fi
NODE_ENV=production exec "${NODE}" $NODE_OPTIONS --no-warnings "${DIR}/src/cli_plugin" "$@"
NODE_OPTIONS="--no-warnings ${NODE_OPTIONS}" NODE_ENV=production exec "${NODE}" "${DIR}/src/cli_plugin" "$@"

View file

@ -14,7 +14,8 @@ If Not Exist "%NODE%" (
)
TITLE Kibana Server
"%NODE%" %NODE_OPTIONS% --no-warnings "%DIR%\src\cli_plugin" %*
set "NODE_OPTIONS=--no-warnings %NODE_OPTIONS%" && "%NODE%" "%DIR%\src\cli_plugin" %*
:finally

View file

@ -14,7 +14,7 @@ If Not Exist "%NODE%" (
Exit /B 1
)
"%NODE%" --no-warnings --max-http-header-size=65536 %NODE_OPTIONS% "%DIR%\src\cli" %*
set "NODE_OPTIONS=--no-warnings --max-http-header-size=65536 %NODE_OPTIONS%" && "%NODE%" "%DIR%\src\cli" %*
:finally

View file

@ -157,7 +157,11 @@ export default class BaseOptimizer {
getThreadLoaderPoolConfig() {
// Calculate the node options from the NODE_OPTIONS env var
const parsedNodeOptions = process.env.NODE_OPTIONS ? process.env.NODE_OPTIONS.split(/\s/) : [];
const parsedNodeOptions = process.env.NODE_OPTIONS
// thread-loader could not receive empty string as options
// or it would break that's why we need to filter here
? process.env.NODE_OPTIONS.split(/\s/).filter(opt => !!opt)
: [];
return {
name: 'optimizer-thread-loader-main-pool',