feat: 优化WebSocket连接和心跳机制
- 在main.py和standalone.py中添加ws_ping_interval和ws_ping_timeout配置 - 调整ws.py中的心跳发送逻辑,先发送ping再等待 - 在host_client中优化消息处理,使用任务队列处理转发请求 - 更新WebTool以适配新的API格式并增加搜索结果限制 - 在agent.py中添加日期显示和web调用次数限制 - 修复bot/handler.py中的事件循环问题
This commit is contained in:
+1
-1
@@ -53,11 +53,11 @@ async def ws_node_endpoint(websocket: WebSocket) -> None:
|
||||
"""Send periodic pings to the host client."""
|
||||
try:
|
||||
while True:
|
||||
await asyncio.sleep(30)
|
||||
try:
|
||||
await websocket.send_text(encode(Heartbeat(type="ping")))
|
||||
except Exception:
|
||||
break
|
||||
await asyncio.sleep(30)
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user