feat: mo_data.py unified read layer (DB-first, JSON fallback) + cash_log table + batch JSON→DB migration (16 files)
This commit is contained in:
@@ -11,6 +11,7 @@ from datetime import datetime
|
||||
from urllib.request import urlopen, Request
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
from threading import Semaphore
|
||||
from mo_data import read_portfolio, read_decisions, read_watchlist
|
||||
|
||||
DATA_DIR = "/home/hmo/web-dashboard/data"
|
||||
DECISIONS_PATH = f"{DATA_DIR}/decisions.json"
|
||||
@@ -135,7 +136,7 @@ def main():
|
||||
codes = set()
|
||||
# 读取持仓+自选
|
||||
try:
|
||||
dec = json.load(open(DECISIONS_PATH))
|
||||
dec = mo_data.read_decisions()
|
||||
for d in dec.get("decisions", []):
|
||||
c = d.get("code", "")
|
||||
if c:
|
||||
|
||||
Reference in New Issue
Block a user