fix: mofin_health 输出缺失检测逻辑(不依赖last_run)

This commit is contained in:
xxm
2026-08-10 18:41:54 +08:00
parent 4d8fde5856
commit 251b52e427
+4 -5
View File
@@ -956,15 +956,14 @@ def build_report():
if _out_dir.exists():
_today = now.strftime("%Y-%m-%d")
_today_files = list(_out_dir.glob(f"*{_today}*"))
_last_run_str = str(j.get("last_run_at", ""))[:10]
_is_today_run = (_last_run_str == _today)
# LLM cron 今天应按调度跑(工作日)但没有今天输出
# 修正2026-08-10:不要求 last_run 今天(失败后 last_run 停在旧日期)
# 只要求:工作日 + 调度含工作日 + 今天无输出
_sched = str(j.get("schedule", ""))
_weekday_only = ("1-5" in _sched or "mon" in _sched.lower())
_is_weekday = now.weekday() < 5
if _is_today_run and not _today_files and (_weekday_only and _is_weekday or not _weekday_only):
if not _today_files and (_weekday_only and _is_weekday):
output_missing = True
output_missing_reason = f"last_status={status}但今天无输出文件"
output_missing_reason = f"今天({_today})工作日应按调度运行但输出目录无文件(last_run={str(j.get('last_run_at',''))[:16]})"
except Exception:
pass
pipelines.append({