Allow scheduled CTP connect when auto-connect setting is off.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+5
-3
@@ -1667,10 +1667,12 @@ def install_trading(app, *, login_required, require_nav, get_db, get_setting, se
|
||||
|
||||
threading.Thread(target=_warm, daemon=True, name="position-bootstrap").start()
|
||||
try:
|
||||
if is_ctp_auto_connect_enabled(get_setting):
|
||||
from vnpy_bridge import ctp_start_connect
|
||||
from ctp_premarket_connect import should_auto_connect_now
|
||||
from vnpy_bridge import ctp_start_connect
|
||||
|
||||
if should_auto_connect_now():
|
||||
mode = get_trading_mode(get_setting)
|
||||
ctp_start_connect(mode, force=False)
|
||||
ctp_start_connect(mode, force=False, scheduled=True)
|
||||
except Exception as exc:
|
||||
logger.debug("bootstrap ctp connect: %s", exc)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user