Don't try to remove websocket from log listeners if it had not been added
This commit is contained in:
parent
2b8a5353be
commit
30a6dd62ef
1 changed files with 2 additions and 1 deletions
|
@ -133,7 +133,8 @@ async def log_websocket(request: web.Request) -> web.WebSocketResponse:
|
|||
await ws.close()
|
||||
except Exception:
|
||||
pass
|
||||
handler.listeners.remove(ws)
|
||||
if authenticated:
|
||||
handler.listeners.remove(ws)
|
||||
log.debug(f"Connection from {request.remote} closed")
|
||||
sockets.remove(ws)
|
||||
return ws
|
||||
|
|
Loading…
Reference in a new issue