From ffe706d0df80fde0a9ec2b9a12919f786f8189b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=89=A7=E6=AF=85?= Date: Sun, 18 May 2025 11:33:00 +0800 Subject: [PATCH] Allow concurrently run server.py and web in production mode. (#25) * Allow concurrently run server.py and web in production mode. * Allow concurrently run server.py and web in production mode. * Allow concurrently run server.py and web in production mode. --- bootstrap.bat | 5 +++-- bootstrap.sh | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bootstrap.bat b/bootstrap.bat index aa7dca9..e96326c 100644 --- a/bootstrap.bat +++ b/bootstrap.bat @@ -10,9 +10,10 @@ IF "%MODE%"=="development" GOTO DEV :PROD echo Starting DeerFlow in [PRODUCTION] mode... -uv run server.py +start uv run server.py cd web -pnpm start +start pnpm start +REM Wait for user to close GOTO END :DEV diff --git a/bootstrap.sh b/bootstrap.sh index e824268..bf84f17 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -11,6 +11,8 @@ if [ "$1" = "--dev" -o "$1" = "-d" -o "$1" = "dev" -o "$1" = "development" ]; th wait else echo -e "Starting DeerFlow in [PRODUCTION] mode...\n" - uv run server.py - cd web && pnpm start + uv run server.py & SERVER_PID=$$! + cd web && pnpm start & WEB_PID=$$! + trap "kill $$SERVER_PID $$WEB_PID" SIGINT SIGTERM + wait fi