Skip to content

Commit 288cfc4

Browse files
committed
pop() instead of del in delete_room()
1 parent 86c08fc commit 288cfc4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

jupyter_rtc_core/rooms/yroom_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@ async def delete_room(self, room_id: str) -> None:
7070
Gracefully deletes a YRoom given a room ID. This stops the YRoom first,
7171
which finishes applying all updates & saves the content automatically.
7272
"""
73-
yroom = self._rooms_by_id.get(room_id, None)
73+
yroom = self._rooms_by_id.pop(room_id, None)
7474
if not yroom:
7575
return
7676

7777
self.log.info(f"Stopping YRoom '{room_id}'.")
7878
await yroom.stop()
7979
self.log.info(f"Stopped YRoom '{room_id}'.")
80-
del self._rooms_by_id[room_id]
8180

8281

8382
async def stop(self) -> None:

0 commit comments

Comments
 (0)