Skip to content

Commit eb7ceb4

Browse files
jkwatsonCopilot
andauthored
kill the startup script if python fails to start (#237)
* kill the startup script if python fails to start * Update scripts/startup_app.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent de92930 commit eb7ceb4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/startup_app.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,15 @@ source scripts/load_nvm.sh > /dev/null
7777
# start Python backend
7878
cd llm-service
7979
mkdir -p $MLFLOW_RECONCILER_DATA_PATH
80-
uv run fastapi run --reload --host 127.0.0.1 --port 8081 2>&1 &
8180

81+
uv run fastapi run --host 127.0.0.1 --port 8081 2>&1 &
82+
PY_BACKGROUND_PID=$!
8283
# wait for the python backend to be ready
8384
while ! curl --output /dev/null --silent --fail http://localhost:8081/amp; do
85+
if ! kill -0 "$PY_BACKGROUND_PID" 2>/dev/null; then
86+
echo "Python backend process exited unexpectedly."
87+
exit 1
88+
fi
8489
echo "Waiting for the Python backend to be ready..."
8590
sleep 4
8691
done

0 commit comments

Comments
 (0)