We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d3d995 commit c1a0f70Copy full SHA for c1a0f70
marimo/_server/rtc/doc.py
@@ -143,9 +143,16 @@ async def remove_client(
143
cleaner.cancel()
144
self.loro_docs_cleaners[file_key] = None
145
# Create a new cleaner with timeout of 60 seconds
146
- self.loro_docs_cleaners[file_key] = asyncio.create_task(
147
- self._clean_loro_doc(file_key, 60.0)
148
- )
+ self.loro_docs_cleaners[file_key] = None
+
+ # Create the cleaner task outside the lock
149
+ if (
150
+ file_key in self.loro_docs_clients
151
+ and len(self.loro_docs_clients[file_key]) == 0
152
+ ):
153
+ self.loro_docs_cleaners[file_key] = asyncio.create_task(
154
+ self._clean_loro_doc(file_key, 60.0)
155
+ )
156
157
async def remove_doc(self, file_key: MarimoFileKey) -> None:
158
"""Remove a loro doc and all associated clients, without waiting."""
0 commit comments