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
+1 -9
View File
@@ -13,7 +13,6 @@ import time
from typing import Callable
from ctp_premarket_connect import should_auto_connect_now
from ctp_settings import is_ctp_auto_connect_enabled
from vnpy_bridge import ctp_try_auto_reconnect
logger = logging.getLogger(__name__)
@@ -40,14 +39,7 @@ def start_ctp_reconnect_worker(
def _loop() -> None:
while True:
try:
gs = get_setting_fn
if gs is None:
from fee_specs import get_setting as gs
if (
is_ctp_auto_connect_enabled(gs)
and _auto_reconnect_enabled()
and should_auto_connect_now()
):
if _auto_reconnect_enabled() and should_auto_connect_now():
mode = get_mode_fn()
if ctp_try_auto_reconnect(mode):
logger.debug("CTP 连接正常 [%s]", mode)