From 1296f08187ef7542f4cb2066304972b0fbe8c790 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 1aa9fe65..4cb85f66 100644 --- a/jupyter_collaboration/rooms.py +++ b/jupyter_collaboration/rooms.py @@ -249,8 +249,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,