From d661cad5ca0db3e0b4a481fa1c35661cc7d7ab2a Mon Sep 17 00:00:00 2001 From: heshunme Date: Sat, 26 Oct 2024 14:49:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/main.py b/main.py index 7ce5f68..9239202 100644 --- a/main.py +++ b/main.py @@ -29,10 +29,6 @@ class ConnectionManager: async def send_personal_message(message: str, websocket: WebSocket): await websocket.send_text(message) - async def broadcast(self, message: str): - for connection in self.active_connections: - await connection.send_text(message) - async def broadcast_json(self, data: dict): for connection in self.active_connections: await connection.send_json(data) @@ -94,7 +90,6 @@ async def predict(file: UploadFile = File(...)): if content: yield content # 同时将内容广播给所有WebSocket连接的客户端 - # await manager.broadcast(content) await manager.broadcast_json({"type": "text", "content": content}) return StreamingResponse(stream_response(), media_type="text/plain")