From 0a345132080b9544715b52dd2f3838d0c3318069 Mon Sep 17 00:00:00 2001 From: "David L. Qiu" Date: Tue, 19 Mar 2024 17:14:26 -0700 Subject: [PATCH] prefer asyncio.create_task() --- jupyter_collaboration/rooms.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jupyter_collaboration/rooms.py b/jupyter_collaboration/rooms.py index d500c96c..93bc9d0b 100644 --- a/jupyter_collaboration/rooms.py +++ b/jupyter_collaboration/rooms.py @@ -258,8 +258,7 @@ async def _maybe_save_document(self) -> None: # do not write to `self._document` in this `try` block, as that will # trigger the observer and result in a save loop. self.log.info("Saving the content from room %s", self._room_id) - loop = asyncio.get_running_loop() - self._save_task = loop.create_task(self._file.maybe_save_content( + self._save_task = asyncio.create_task(self._file.maybe_save_content( { "format": self._file_format, "type": self._file_type,