Skip to content

Commit

Permalink
Remove client on failure. (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
darabos authored Dec 10, 2024
1 parent e543be7 commit d208ff0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pycrdt_websocket/yroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ async def serve(self, websocket: Websocket):
tg.start_soon(client.send, message)
# apply awareness update to the server's awareness
self.awareness.apply_awareness_update(read_message(message[1:]), self)
# remove this client
self.clients.remove(websocket)
except Exception as exception:
self._handle_exception(exception)
finally:
# remove this client
self.clients.remove(websocket)

def send_server_awareness(self, type: str, changes: tuple[dict[str, Any], Any]) -> None:
"""
Expand Down

0 comments on commit d208ff0

Please sign in to comment.