Allow scheduled CTP connect when auto-connect setting is off.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-29 20:38:30 +08:00
parent c5262a0a54
commit 94c566fbe5
8 changed files with 39 additions and 36 deletions
+5 -3
View File
@@ -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)