Fix server hang: stop CTP reconnect storm and throttle live account polling.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-03 21:24:30 +08:00
parent d6776d2b8e
commit 9508d88938
5 changed files with 38 additions and 18 deletions
+2 -1
View File
@@ -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"):