优化: Keep-Alive/rate-limiter/dead-code清理 + deploy.sh蓝绿自动检测 + 压测文档
This commit is contained in:
@@ -108,13 +108,21 @@ check_service_file() {
|
||||
|
||||
# ---------- 蓝绿部署:检查目标是否为当前活动环境 ----------
|
||||
NGINX_CONTAINER="1Panel-openresty-ABu5"
|
||||
ROOT_PROXY_CONF="/www/sites/xmclassmate.top/proxy/root.conf"
|
||||
|
||||
get_proxy_conf() {
|
||||
if [ "${APP_ENV}" = "development" ]; then
|
||||
echo "/www/sites/dev.xmclassmate.top/proxy/root.conf"
|
||||
else
|
||||
echo "/www/sites/xmclassmate.top/proxy/root.conf"
|
||||
fi
|
||||
}
|
||||
|
||||
check_not_active() {
|
||||
[ -z "$BG_TARGET" ] && return 0 # 非蓝绿部署,跳过
|
||||
|
||||
local proxy_conf; proxy_conf=$(get_proxy_conf)
|
||||
local active_env
|
||||
active_env=$(remote "docker exec ${NGINX_CONTAINER} cat ${ROOT_PROXY_CONF} 2>/dev/null" 2>/dev/null | grep -oP '127\.0\.0\.1:(4433|4434)' | head -1 || echo "")
|
||||
active_env=$(remote "docker exec ${NGINX_CONTAINER} cat ${proxy_conf} 2>/dev/null" 2>/dev/null | grep -oP '127\.0\.0\.1:\d+' | head -1 || echo "")
|
||||
|
||||
local current_target
|
||||
case "$active_env" in
|
||||
|
||||
Reference in New Issue
Block a user