Skip to content

Commit

Permalink
feat: modify shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
echonoshy committed Oct 16, 2024
1 parent 1dad790 commit 8516089
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions instances/fastapi_server/scripts/shutdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ PIDS=$(lsof -t -i:$PORT)
if [ -z "$PIDS" ]; then
echo "No process found running on port $PORT"
else
# 逐个终止所有找到的进程
for PID in $PIDS; do
kill -9 $PID
echo "Terminated process with PID $PID."
done
# 终止所有找到的进程
lsof -t -i:$PORT | xargs kill -9
echo "All FastAPI services running on port $PORT have been stopped."
fi

0 comments on commit 8516089

Please sign in to comment.