Fix server hang: stop CTP reconnect storm and throttle live account polling.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -18,7 +18,7 @@ from modules.market.market_sessions import (
|
||||
is_trading_session,
|
||||
should_keep_ctp_connected,
|
||||
)
|
||||
from modules.ctp.vnpy_bridge import ctp_start_connect, ctp_status, ctp_session_needs_reconnect
|
||||
from modules.ctp.vnpy_bridge import ctp_start_connect, ctp_status, ctp_session_needs_reconnect, get_bridge
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -114,6 +114,7 @@ def start_ctp_premarket_connect_worker(
|
||||
or is_trading_session()
|
||||
)
|
||||
and ctp_session_needs_reconnect(mode)
|
||||
and not get_bridge().connect_in_progress()
|
||||
):
|
||||
info = ctp_start_connect(mode, force=True, scheduled=True)
|
||||
if info.get("started") or info.get("connecting"):
|
||||
|
||||
Reference in New Issue
Block a user