fix: 修正持仓 worker 中 bool 优先级导致 .get 报错。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-25 13:52:09 +08:00
parent bbcc5607ad
commit 86e61df993
+2 -1
View File
@@ -83,7 +83,8 @@ def start_position_worker(
payload = refresh_fn()
if payload:
position_hub.broadcast("positions", payload)
connected = bool((payload or {}).get("ctp_status") or {}).get("connected")
ctp_st = (payload or {}).get("ctp_status") or {}
connected = bool(ctp_st.get("connected"))
in_session = bool((payload or {}).get("trading_session"))
rows = (payload or {}).get("rows") or []
has_sl_tp = any(