Stop PM2 before PostgreSQL init to free connection pool.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-01 08:17:29 +08:00
parent 2347276bf4
commit 843b68b412
+6
View File
@@ -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 \