mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Fix: Add timeout on websocket accept (#4169)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import os
|
||||
import re
|
||||
import tempfile
|
||||
@@ -257,7 +258,7 @@ async def websocket_endpoint(websocket: WebSocket):
|
||||
{"action": "finish", "args": {}}
|
||||
```
|
||||
"""
|
||||
await websocket.accept()
|
||||
await asyncio.wait_for(websocket.accept(), 10)
|
||||
|
||||
if websocket.query_params.get('token'):
|
||||
token = websocket.query_params.get('token')
|
||||
|
||||
Reference in New Issue
Block a user