Skip to content

Commit

Permalink
queue websocket disconnect if exc is None on connection lost
Browse files Browse the repository at this point in the history
  • Loading branch information
sephioh authored and Kludex committed Oct 29, 2022
1 parent 641e8c5 commit 37cc16c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions uvicorn/protocols/websockets/wsproto_impl.py
Expand Up @@ -70,8 +70,7 @@ def connection_made(self, transport):
self.logger.log(TRACE_LOG_LEVEL, "%sWebSocket connection made", prefix)

def connection_lost(self, exc):
if exc is not None:
self.queue.put_nowait({"type": "websocket.disconnect"})
self.queue.put_nowait({"type": "websocket.disconnect"})
self.connections.remove(self)

if self.logger.level <= TRACE_LOG_LEVEL:
Expand Down

0 comments on commit 37cc16c

Please sign in to comment.