From d94b8edfc7aa9a834277abdc278343a9bb9a92d7 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Thu, 28 May 2026 12:41:30 +0800 Subject: [PATCH] auto-sync: 2026-05-28 12:41:30 --- scripts/gateway-watchdog.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/gateway-watchdog.sh b/scripts/gateway-watchdog.sh index b557240..1427d45 100755 --- a/scripts/gateway-watchdog.sh +++ b/scripts/gateway-watchdog.sh @@ -52,8 +52,9 @@ count_recent_429() { [ "$fsize" -lt 100 ] && continue # 搜索 429 错误:errorCode=1305 或 errorMessage 含 "429" - local found - found=$(grep -c '"errorCode".*"1305"\|"errorMessage".*"429"' "$jsonl" 2>/dev/null || echo 0) + local found=0 + found=$(grep -c '"errorCode".*"1305"\|"errorMessage".*"429"' "$jsonl" 2>/dev/null || true) + [ -z "$found" ] && found=0 # 进一步过滤:只统计时间窗口内的 if [ "$found" -gt 0 ]; then local recent