deploy: 安全部署脚本,清理实验配置由仓库脚本负责
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
24
deploy/cleanup-lag-experiments.sh
Normal file
24
deploy/cleanup-lag-experiments.sh
Normal 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 "清理完成。"
|
||||
Reference in New Issue
Block a user