Skip to content

Commit 251b0f5

Browse files
committed
Fix gunicorn opts
1 parent 4932336 commit 251b0f5

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

bin/nest-server

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,10 @@ set-gunicorn_opts() {
4343
# Set opts for gunicorn.
4444
GUNICORN_OPTS="--bind ${HOST}:${PORT}"
4545
GUNICORN_OPTS="${GUNICORN_OPTS} --log-file ${LOGFILE}"
46-
if [ "${DAEMON}" -eq 1 ]; then
47-
GUNICORN_OPTS="${GUNICORN_OPTS} --daemon"
48-
fi
49-
if [ "${STDOUT}" -eq 0 ]; then
50-
GUNICORN_OPTS="${GUNICORN_OPTS} --capture-output"
51-
fi
52-
if [ "${TIMEOUT}" -ne 30 ]; then
53-
GUNICORN_OPTS="${GUNICORN_OPTS} --timeout ${TIMEOUT}"
54-
fi
55-
if [ "${WORKERS}" -gt 1 ]; then
56-
GUNICORN_OPTS="${GUNICORN_OPTS} --workers ${WORKERS}"
57-
fi
46+
[[ "${DAEMON}" -eq 1 ]] && GUNICORN_OPTS="${GUNICORN_OPTS} --daemon"
47+
[[ "${STDOUT}" -eq 0 ]] && GUNICORN_OPTS="${GUNICORN_OPTS} --capture-output"
48+
[[ "${TIMEOUT}" -ne 30 ]] && GUNICORN_OPTS="${GUNICORN_OPTS} --timeout ${TIMEOUT}"
49+
[[ "${WORKERS}" -gt 1 ]] && GUNICORN_OPTS="${GUNICORN_OPTS} --workers ${WORKERS}"
5850
}
5951

6052
start() {
@@ -65,9 +57,7 @@ start() {
6557
echo "NEST Server is now running at http://${HOST}:${PORT}."
6658
if [ "${DAEMON}" -eq 0 ]; then
6759
echo "Use CTRL + C to stop this service."
68-
if [ "${STDOUT}" -eq 1 ]; then
69-
echo "-----------------------------------------------------"
70-
fi
60+
[[ "${STDOUT}" -eq 1 ]] && echo "-----------------------------------------------------"
7161
fi
7262

7363
set-gunicorn_opts

0 commit comments

Comments
 (0)