This commit is contained in:
yumoqing 2024-04-29 15:06:15 +08:00
parent 7eacc6e625
commit 8e84ccecce

View File

@ -128,9 +128,13 @@ class WsPool:
async def sendto(self, data, id=None): async def sendto(self, data, id=None):
if id is None: if id is None:
return await ws_send(self.ws, data) return await ws_send(self.ws, data)
d = self.get_data() try:
ws = d.get(id) d = self.get_data()
return await ws_send(ws, data) ws = d.get(id)
return await ws_send(ws, data)
except Exception as e:
print('ws.sendto() error:', e)
return False
class WebsocketProcessor(PythonScriptProcessor): class WebsocketProcessor(PythonScriptProcessor):
@classmethod @classmethod