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):
if id is None:
return await ws_send(self.ws, data)
d = self.get_data()
ws = d.get(id)
return await ws_send(ws, data)
try:
d = self.get_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):
@classmethod