From 5937776c9365dc8d8baaf834ebf0938129fc2903 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Thu, 28 May 2026 12:25:40 +0800 Subject: [PATCH] auto-sync: 2026-05-28 12:25:40 --- scripts/gateway-watchdog.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/gateway-watchdog.sh b/scripts/gateway-watchdog.sh index d181026..285cac6 100755 --- a/scripts/gateway-watchdog.sh +++ b/scripts/gateway-watchdog.sh @@ -35,7 +35,8 @@ count_recent_429() { [ -f "$jsonl" ] || continue # 只看最近修改的文件(性能优化) local mtime - mtime=$(stat -f %m "$jsonl" 2>/dev/null || stat -c %Y "$jsonl" 2>/dev/null) + mtime=$(stat -f '%m' "$jsonl" 2>/dev/null | tr -d ' ' || stat -c '%Y' "$jsonl" 2>/dev/null | tr -d ' ') + [ -z "$mtime" ] && continue local now=$(date +%s) local age=$(( now - mtime )) # 文件超过 CHECK_WINDOW 秒没修改就跳过