From 6ff392edc05b3548925b67af5ff8e90e62d7e1a1 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 2 Oct 2025 01:58:06 -0500 Subject: [PATCH] refac/enh: start.sh additional args support --- backend/start.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/backend/start.sh b/backend/start.sh index c32498aa45..bc57b2bb03 100755 --- a/backend/start.sh +++ b/backend/start.sh @@ -70,5 +70,18 @@ if [ -n "$SPACE_ID" ]; then fi PYTHON_CMD=$(command -v python3 || command -v python) +UVICORN_WORKERS="${UVICORN_WORKERS:-1}" -WEBUI_SECRET_KEY="$WEBUI_SECRET_KEY" exec "$PYTHON_CMD" -m uvicorn open_webui.main:app --host "$HOST" --port "$PORT" --forwarded-allow-ips '*' --workers "${UVICORN_WORKERS:-1}" +# If script is called with arguments, use them; otherwise use default workers +if [ "$#" -gt 0 ]; then + ARGS=("$@") +else + ARGS=(--workers "$UVICORN_WORKERS") +fi + +# Run uvicorn +exec "$PYTHON_CMD" -m uvicorn open_webui.main:app \ + --host "$HOST" \ + --port "$PORT" \ + --forwarded-allow-ips '*' \ + "${ARGS[@]}" \ No newline at end of file