From 0d95de2fc2c95209be30102b11a6c9a8a59a08cc Mon Sep 17 00:00:00 2001 From: claude_dev Date: Sun, 16 Aug 2026 19:21:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E5=83=B5=E5=B0=B8=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E5=AE=88=E5=8D=ABZPID=E6=8F=90=E5=8F=96=E8=A1=8C=E5=8A=A0||tru?= =?UTF-8?q?e=E5=85=9C=E5=BA=95=E2=80=94=E2=80=94run674=E5=AE=9E=E5=BD=95:/?= =?UTF-8?q?end=E5=B9=B2=E5=87=80=E6=9D=80=E6=8E=89=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3=E5=B7=B2=E7=A9=BA,grep=E6=97=A0=E5=8C=B9=E9=85=8D+set?= =?UTF-8?q?=20-e=20-o=20pipefail=E6=8A=8A=E6=95=B4=E6=AD=A5=E7=82=B8?= =?UTF-8?q?=E5=9C=A8=E6=8F=90=E5=8F=96=E8=A1=8C,=E6=AD=BB=E5=9C=A8schtasks?= =?UTF-8?q?=20/run=E5=89=8D=E2=86=92API=E5=81=9C=E5=9C=A8=E5=8D=8A?= =?UTF-8?q?=E8=B7=AF(=E5=B7=B2=E6=89=8B=E5=8A=A8/run=E6=95=91=E5=9B=9E);?= =?UTF-8?q?=E5=AE=88=E5=8D=AB=E9=80=BB=E8=BE=91=E4=B8=8D=E5=8F=98,?= =?UTF-8?q?=E4=BB=85=E5=AE=B9=E5=BF=8D=E7=A9=BA=E7=BB=93=E6=9E=9C=20[nas]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/vps-deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/vps-deploy.yml b/.gitea/workflows/vps-deploy.yml index bfdb734..2d1e89a 100644 --- a/.gitea/workflows/vps-deploy.yml +++ b/.gitea/workflows/vps-deploy.yml @@ -70,7 +70,9 @@ jobs: # 2026-08-16 实录: /end 杀不掉 uvicorn reload 孤儿子进程, 旧进程跨两轮 # 部署占 8000, 新实例静默抢不到端口, /docs 200 验的还是旧代码 → 500 旧 bug 重现 ssh 49.232.102.198 'schtasks /end /tn sanguo-api' || true - ZPID=$(ssh 49.232.102.198 'netstat -ano -p tcp' | tr -d '\r' | grep ':8000' | grep -i LISTENING | awk '{print $NF}' | sort -u | head -1) + # 注意 || true 兜底: 端口已空时 grep 无匹配, set -e -o pipefail 会把整步炸掉 + # (2026-08-16 run674 实录: /end 干净杀掉后 180ms 死在这行, API 停在半路) + ZPID=$(ssh 49.232.102.198 'netstat -ano -p tcp' | tr -d '\r' | grep ':8000' | grep -i LISTENING | awk '{print $NF}' | sort -u | head -1 || true) if [ -n "$ZPID" ]; then echo "僵尸 API 进程 PID=$ZPID 仍占 8000, 强杀" ssh 49.232.102.198 "taskkill /F /T /PID $ZPID" || true