From d4b970cfd5174937df45960d7bb87eb6cfe4cd91 Mon Sep 17 00:00:00 2001 From: dekun Date: Wed, 14 Oct 2026 09:17:40 +0800 Subject: [PATCH] Allow CoinOX to start without manual_trading_hub by stubbing hub settings imports. Co-authored-by: Cursor --- lib/hub/hub_calculator_market_lib.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/hub/hub_calculator_market_lib.py b/lib/hub/hub_calculator_market_lib.py index d1ba5cd..453aa0e 100644 --- a/lib/hub/hub_calculator_market_lib.py +++ b/lib/hub/hub_calculator_market_lib.py @@ -13,7 +13,15 @@ from urllib.parse import urlencode try: from settings_store import enabled_exchanges, load_settings except ImportError: - from manual_trading_hub.settings_store import enabled_exchanges, load_settings + try: + from manual_trading_hub.settings_store import enabled_exchanges, load_settings + except ImportError: + # CoinOX 独立实例无中控:精度函数仍可用;中控拉实例行情相关 API 不可用 + def load_settings() -> dict[str, Any]: + return {"exchanges": []} + + def enabled_exchanges() -> list: + return [] MARKET_CACHE: dict[str, tuple[float, dict[str, Any]]] = {} MARKET_LOCK = threading.Lock()