fix: 审计交易时间窗口9-16→10-15(盘前采集窗口内数据停上一交易日是正常的,9:18误报macro_context_log)

This commit is contained in:
xxm
2026-08-24 09:23:37 +08:00
parent 9970886156
commit 62d52d5d04
@@ -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: