forked from Rockachopa/Timmy-time-dashboard
fix: resolve WebSocket crashes from websockets 16.0 incompatibility (#97)
The /ws redirect handler crashed with AttributeError because websockets 16.0 removed the legacy transfer_data_task attribute. The /swarm/live endpoint could also error on early client disconnects during accept. Co-authored-by: Alexander Payne <apayne@MM.local> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
b7c89d1101
commit
d4acaefee9
@@ -409,7 +409,11 @@ def submit_bid(bid: BidRequest):
|
||||
@router.websocket("/live")
|
||||
async def swarm_live(websocket: WebSocket):
|
||||
"""WebSocket endpoint for live swarm event streaming."""
|
||||
await ws_manager.connect(websocket)
|
||||
try:
|
||||
await ws_manager.connect(websocket)
|
||||
except Exception as exc:
|
||||
logger.warning("WebSocket accept failed: %s", exc)
|
||||
return
|
||||
try:
|
||||
while True:
|
||||
data = await websocket.receive_text()
|
||||
|
||||
Reference in New Issue
Block a user