diff --git a/scripts/deploy_postgres.sh b/scripts/deploy_postgres.sh index c2a0651..40fe8d2 100644 --- a/scripts/deploy_postgres.sh +++ b/scripts/deploy_postgres.sh @@ -66,6 +66,12 @@ echo "==> Python 依赖..." source "$APP_DIR/venv/bin/activate" pip install -q -r "$APP_DIR/requirements.txt" +echo "==> 停止 qihuo(释放数据库连接)..." +if pm2 describe qihuo &>/dev/null; then + pm2 stop qihuo || true + sleep 2 +fi + if [ "$MIGRATE_SQLITE" = "1" ]; then echo "==> 重置 PostgreSQL 库(迁移模式)..." sudo -u postgres psql -v ON_ERROR_STOP=0 -c \