diff --git a/deploy/profile-scripts/system_hygiene_audit.py b/deploy/profile-scripts/system_hygiene_audit.py index 9f8b94ec..0563b66a 100644 --- a/deploy/profile-scripts/system_hygiene_audit.py +++ b/deploy/profile-scripts/system_hygiene_audit.py @@ -355,8 +355,11 @@ def check_db_freshness(): try: c = sqlite3.connect(os.path.join(DATA_DIR, 'mofin.db'), timeout=10) now = datetime.now() - is_trading_time = now.weekday() < 5 and 9 <= now.hour <= 16 - # 2026-08-24 周末豁免:非交易阈值需覆盖周末休市(周五17:00→周一09:30≈64.5h), + # 2026-08-24 窗口收窄:10-15点才算交易时间——9:00-9:30盘前采集窗口内数据 + # 停在上一交易日是正常的(refresh_macro_context等9:00盘前取不到实时指数不写), + # 10点后采集窗口已过,4h阈值抓的是真停滞 + is_trading_time = now.weekday() < 5 and 10 <= now.hour <= 15 + # 周末豁免:非交易阈值需覆盖周末休市(周五17:00→周一09:30≈64.5h), # 48h 导致周一早上必误报;真停滞会在下一交易时段被 4h 阈值抓住,不会漏 for table, col, label in CORE_TABLES: try: