Skip to content

Commit

Permalink
fix: remove websocket object from session on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Sep 6, 2023
1 parent 0fec988 commit f50351e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions solara/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ async def app_loop(ws: websocket.WebsocketWrapper, session_id: str, connection_i
try:
message = await ws.receive()
except websocket.WebSocketDisconnect:
try:
context.kernel.session.websockets.remove(ws)
except KeyError:
pass
logger.debug("Disconnected")
return
t0 = time.time()
Expand Down

0 comments on commit f50351e

Please sign in to comment.