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:
+5
-1
@@ -30,9 +30,13 @@ def resolve_frontend_dist() -> Path:
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
settings = get_settings()
|
||||
db = Database()
|
||||
set_db(db)
|
||||
# 必须在 set_db 之后读 DB 覆盖,否则会按 .env 默认 okx 起会话,
|
||||
# 而 health 显示 DB 里的 binance → 合约号/盘口错乱(期权一直 -/-)
|
||||
from .exchange.runtime import load_runtime_settings
|
||||
|
||||
settings = load_runtime_settings()
|
||||
engine = StrategyEngine()
|
||||
set_engine(engine)
|
||||
engine.ensure_loop()
|
||||
|
||||
Reference in New Issue
Block a user