Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update node options Initialization on our scripts #40302

Merged
merged 13 commits into from
Aug 15, 2019
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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