From fa163f53f9507eccaa28ad64cead4dd93e42ce91 Mon Sep 17 00:00:00 2001 From: hmo Date: Wed, 22 Jul 2026 09:20:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BC=80=E7=9B=98grace(09:00-09:15)?= =?UTF-8?q?=E2=80=94=E2=80=94=E7=AE=A1=E9=81=93=E5=88=9A=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=E9=9A=94=E5=A4=9C=E6=95=B0=E6=8D=AE=E4=B8=8D=E8=AF=AF?= =?UTF-8?q?=E6=8A=A5=EF=BC=88verify=E7=AE=A1=E9=81=93=E5=AE=A1=E8=AE=A1+L1?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A3=80=E6=9F=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/functional_health_check.py | 5 +++++ deploy/profile-scripts/verify_reassess_pipeline.py | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/deploy/profile-scripts/functional_health_check.py b/deploy/profile-scripts/functional_health_check.py index 7b868d29..9e491141 100644 --- a/deploy/profile-scripts/functional_health_check.py +++ b/deploy/profile-scripts/functional_health_check.py @@ -248,6 +248,11 @@ def main(): results.append({"module": item["module"], "function": item["function"], "status": "skip", "reason": "非交易时段"}) continue + # 开盘 grace:各管道 09:00 才启动,09:15 前隔夜数据属正常,不误报 + if when == "trading" and now.weekday() < 5 and now.hour == 9 and now.minute < 15: + results.append({"module": item["module"], "function": item["function"], + "status": "skip", "reason": "开盘grace期"}) + continue if when == "daily": # 每日类:只 fail 不 warn,且非交易日放宽到 72h if now.weekday() >= 5: diff --git a/deploy/profile-scripts/verify_reassess_pipeline.py b/deploy/profile-scripts/verify_reassess_pipeline.py index 0e99fd4d..910f32ed 100644 --- a/deploy/profile-scripts/verify_reassess_pipeline.py +++ b/deploy/profile-scripts/verify_reassess_pipeline.py @@ -94,6 +94,10 @@ def run(): # 1. price_monitor 最近运行时间 try: + # 开盘 grace:price_monitor 09:00 才启动,09:15 前隔夜数据属正常,不误报 + from datetime import datetime as _dt + _now = _dt.now() + _morning_grace = _now.weekday() < 5 and _now.hour == 9 and _now.minute < 15 conn = None last_err = None # malformed 可能是 I/O 风暴下的瞬态 WAL 损坏(2026-07-21 事件): @@ -117,11 +121,11 @@ def run(): lp_dt = lp_dt.replace(tzinfo=None) mins_ago = (datetime.now() - lp_dt).total_seconds() / 60 status = "ok" if mins_ago < 10 else "warn" - if mins_ago > 15: + if mins_ago > 15 and not _morning_grace: status = "fail" ok = False alerts.append(f"price_monitor {mins_ago:.0f}分未更新") - checks.append({"check":"price_monitor","status":status,"detail":f"最后更新{mins_ago:.0f}分前"}) + checks.append({"check":"price_monitor","status":status,"detail":f"最后更新{mins_ago:.0f}分前" + ("(开盘grace)" if _morning_grace and mins_ago > 15 else "")}) else: checks.append({"check":"price_monitor","status":"warn","detail":"live_prices无数据"}) except Exception as e: