Fix Binance boot using OKX symbols after restart.

Startup ignored DB exchange choice and kept OKX ATM ids under a Binance health label, so option bid/ask stayed empty.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-25 12:13:19 +08:00
parent d701d30c04
commit 586469482e
4 changed files with 52 additions and 6 deletions
+6 -2
View File
@@ -330,10 +330,14 @@ set_gateway = set_session
def bootstrap_session(settings: Settings | None = None) -> StrategySession:
"""main 启动:创建交易所 + 策略会话。"""
"""main 启动:创建交易所 + 策略会话。始终以 DB 覆盖后的 runtime 为准。"""
from ..exchange.runtime import load_runtime_settings
s = settings or load_runtime_settings()
# 忽略裸 get_settings():重启后必须跟 DB 里选的交易所一致
try:
s = load_runtime_settings()
except Exception:
s = settings or get_settings()
ex = build_exchange(s)
set_exchange(ex)
sess = StrategySession(s, ex)