Update for pip check when restart backend service

This commit is contained in:
timqiu 2025-03-16 20:32:53 +08:00
parent c16b869f6f
commit 736d426cc1

View File

@ -867,6 +867,12 @@ docker exec -i "$DEVBOX_NAME" bash <<EOF
./start_webapi.sh > /home/devbox/logs/backend.logs 2>&1 &
else
echo "==> [BACKEND] Backend dependencies already installed. Skipping installation."
# Check if all dependencies are installed, if not, install them
if ! pip check; then
echo "==> [BACKEND] Some dependencies are missing. Reinstalling..."
pip install -r /home/devbox/freeleaps/apps/requirements.txt
fi
# Check if the backend service is already running
SERVICE_API_ACCESS_PORT=\$(cat /home/devbox/.devbox-backend-port)
uvicorn freeleaps.webapi.main:app --reload --host 0.0.0.0 --port \$SERVICE_API_ACCESS_PORT > /home/devbox/logs/backend.logs 2>&1 &