From bd8f6b5dacb0b5f4e76c3146ea16152be371c786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=A5=E5=BE=AE?= Date: Wed, 8 Jul 2026 23:54:16 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B8=85=E7=90=86=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/.hermes-tmp.2983720 | 0 scripts/.hermes-tmp.2983724 | 0 scripts/sync_db_to_json.py.bak | 26 -------------------------- 3 files changed, 26 deletions(-) delete mode 100644 scripts/.hermes-tmp.2983720 delete mode 100644 scripts/.hermes-tmp.2983724 delete mode 100644 scripts/sync_db_to_json.py.bak diff --git a/scripts/.hermes-tmp.2983720 b/scripts/.hermes-tmp.2983720 deleted file mode 100644 index e69de29b..00000000 diff --git a/scripts/.hermes-tmp.2983724 b/scripts/.hermes-tmp.2983724 deleted file mode 100644 index e69de29b..00000000 diff --git a/scripts/sync_db_to_json.py.bak b/scripts/sync_db_to_json.py.bak deleted file mode 100644 index 43ab5933..00000000 --- a/scripts/sync_db_to_json.py.bak +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python3 -"""sync_db_to_json.py — 将DB数据同步回JSON文件(反向同步) - -DB是权威源,JSON文件是只读的兼容层。 -每15分钟将DB中的决策数据写到decisions.json。 -""" -import json, sys -from pathlib import Path -sys.path.insert(0, str(Path(__file__).parent.parent)) -sys.path.insert(0, "/home/hmo/MoFin") - -DECISIONS_PATH = "/home/hmo/web-dashboard/data/decisions.json" - -try: - from mo_data import read_decisions, read_portfolio, read_watchlist - decisions = read_decisions() - portfolio = read_portfolio() - watchlist = read_watchlist() - - with open(DECISIONS_PATH, "w") as f: - json.dump(decisions, f, ensure_ascii=False, indent=2) - - cnt = len(decisions.get("decisions", [])) - print(f"[SILENT] decisions.json updated: {cnt} entries from DB") -except Exception as e: - print(f"[SILENT] sync failed: {e}")