Skip to content

Commit

Permalink
Update node options Initialization on our scripts (#40302)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mistic authored Aug 15, 2019
1 parent bd8984b commit f9fbc5d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/kibana
Original file line number Diff line number Diff line change
Expand Up @@ -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" ${@}
2 changes: 1 addition & 1 deletion bin/kibana-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -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" "$@"
3 changes: 2 additions & 1 deletion bin/kibana-plugin.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion bin/kibana.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion src/optimize/base_optimizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit f9fbc5d

Please sign in to comment.