Skip to content

Commit a7c90a5

Browse files
committed
disable _watch_rooms() task
1 parent ef31982 commit a7c90a5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

jupyter_server_documents/rooms/yroom_manager.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class YRoomManager():
4040
event_logger: EventLogger
4141
loop: asyncio.AbstractEventLoop
4242
log: logging.Logger
43-
_watch_rooms_task: asyncio.Task
43+
_watch_rooms_task: asyncio.Task | None
4444

4545
def __init__(
4646
self,
@@ -66,7 +66,8 @@ def __init__(
6666

6767
# Start `self._watch_rooms()` background task to automatically stop
6868
# empty rooms
69-
self._watch_rooms_task = self.loop.create_task(self._watch_rooms())
69+
# TODO: Do not enable this until #120 is addressed.
70+
# self._watch_rooms_task = self.loop.create_task(self._watch_rooms())
7071

7172

7273
@property
@@ -223,7 +224,8 @@ def stop(self) -> None:
223224
Gracefully deletes each `YRoom`. See `delete_room()` for more info.
224225
"""
225226
# First, stop all background tasks
226-
self._watch_rooms_task.cancel()
227+
if self._watch_rooms_task:
228+
self._watch_rooms_task.cancel()
227229

228230
# Get all room IDs. If there are none, return early.
229231
room_ids = list(self._rooms_by_id.keys())

0 commit comments

Comments
 (0)