fix: 健康JSON同时写入static供dashboard serve

This commit is contained in:
知微
2026-07-08 12:13:38 +08:00
parent b23e7736ee
commit a288316a5e
+4
View File
@@ -12,6 +12,7 @@ from datetime import datetime, timezone
DATA_DIR = Path("/home/hmo/MoFin/data")
WEB_DATA = Path("/home/hmo/web-dashboard/data")
STATIC_DIR = Path("/home/hmo/web-dashboard/static")
PROFILE_SCRIPTS = Path("/home/hmo/.hermes/profiles/position-analyst/scripts")
CRON_FILES = [
"/home/hmo/.hermes/profiles/position-analyst/cron/jobs.json",
@@ -219,6 +220,9 @@ def build_report():
out_path = WEB_DATA / "mofin_health.json"
with open(out_path, "w") as f:
json.dump(report, f, ensure_ascii=False, indent=2)
# 也写到static目录供dashboard直接serve
with open(STATIC_DIR / "mofin_health.json", "w") as f:
json.dump(report, f, ensure_ascii=False, indent=2)
print(f"[SILENT] mofin_health.json written ({len(entities)} entities, {len(pipelines)} pipelines)")
if __name__ == "__main__":