deploy: 安全部署脚本,清理实验配置由仓库脚本负责

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-09 04:52:41 +08:00
parent 5429652749
commit 1f2a7a32af
3 changed files with 53 additions and 26 deletions

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# 仅撤销「排查实验」加的配置cron 保活、慢请求追踪 override
# 由仓库脚本执行,不需要你手动 rm 任何路径
set -e
DJANGO_DIR="/opt/1panel/apps/openresty/nginx/www/sites/43.142.166.152.443/django"
cd "$DJANGO_DIR"
if [ -f /etc/cron.d/gunicorn-warmup ]; then
if grep -q 'gunicorn-warmup.sh' /etc/cron.d/gunicorn-warmup 2>/dev/null; then
echo ">>> 移除本仓库安装的 cron 保活"
rm -f /etc/cron.d/gunicorn-warmup
else
echo ">>> 跳过 cron非本仓库创建的文件"
fi
fi
if [ -f /etc/systemd/system/gunicorn-dianjing.service.d/slow-trace.conf ]; then
echo ">>> 关闭慢请求追踪 override"
rm -f /etc/systemd/system/gunicorn-dianjing.service.d/slow-trace.conf
systemctl daemon-reload
systemctl restart gunicorn-dianjing.service
fi
echo "清理完成。"