text exporter
This commit is contained in:
@@ -446,8 +446,8 @@ class EnhancedCOBWebSocket:
|
||||
# Add ping/pong handling and proper connection management
|
||||
async with websockets_connect(
|
||||
ws_url,
|
||||
ping_interval=20, # Binance sends ping every 20 seconds
|
||||
ping_timeout=60, # Binance disconnects after 1 minute without pong
|
||||
ping_interval=25, # Slightly longer than default
|
||||
ping_timeout=90, # Allow longer time before timeout
|
||||
close_timeout=10
|
||||
) as websocket:
|
||||
# Connection successful
|
||||
@@ -539,8 +539,11 @@ class EnhancedCOBWebSocket:
|
||||
|
||||
# Wait before reconnecting
|
||||
status.increase_reconnect_delay()
|
||||
logger.info(f"Waiting {status.reconnect_delay:.1f}s before reconnecting {symbol}")
|
||||
await asyncio.sleep(status.reconnect_delay)
|
||||
# Add jitter to avoid synchronized reconnects
|
||||
jitter = 0.5 + (random.random() * 1.5)
|
||||
delay = status.reconnect_delay * jitter
|
||||
logger.info(f"Waiting {delay:.1f}s before reconnecting {symbol}")
|
||||
await asyncio.sleep(delay)
|
||||
|
||||
async def _process_websocket_message(self, symbol: str, data: Dict):
|
||||
"""Process WebSocket message and convert to COB format
|
||||
|
||||
Reference in New Issue
Block a user