change rule

This commit is contained in:
yanyongyu
2020-08-14 17:41:24 +08:00
parent 04f4d5028e
commit 1dcc43161a
13 changed files with 252 additions and 192 deletions

View File

@ -152,15 +152,16 @@ class Driver(BaseDriver):
await websocket.accept()
self._clients[x_self_id] = bot
while not websocket.closed:
data = await websocket.receive()
try:
while not websocket.closed:
data = await websocket.receive()
if not data:
continue
if not data:
continue
await bot.handle_message(data)
del self._clients[x_self_id]
await bot.handle_message(data)
finally:
del self._clients[x_self_id]
class WebSocket(BaseWebSocket):