refactor(chat_manager.py): use dict.pop() method to remove client_id from active_connections dictionary

This commit is contained in:
Gabriel Almeida 2023-05-11 11:15:51 -03:00
commit 2e16618e47

View file

@ -90,7 +90,7 @@ class ChatManager:
self.active_connections[client_id] = websocket
def disconnect(self, client_id: str):
del self.active_connections[client_id]
self.active_connections.pop(client_id, None)
async def send_message(self, client_id: str, message: str):
websocket = self.active_connections[client_id]