Allow scheduled CTP connect when auto-connect setting is off.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+1
-9
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user