refactor(chat_manager.py): use dict.pop() method to remove client_id from active_connections dictionary
This commit is contained in:
parent
b16084d927
commit
2e16618e47
1 changed files with 1 additions and 1 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue