Skip to content

Commit

Permalink
Use YStore's start_lock
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed May 7, 2024
1 parent 85c5220 commit 24e8c18
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jupyter_collaboration/rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ async def initialize(self) -> None:
# try to apply Y updates from the YStore for this document
read_from_source = True
if self.ystore is not None:
if not self.ystore.started.is_set():
self.create_task(self.ystore.start())
await self.ystore.started.wait()
async with self.ystore.start_lock:
if not self.ystore.started.is_set():
self.create_task(self.ystore.start())
await self.ystore.started.wait()
try:
await self.ystore.apply_updates(self.ydoc)
self._emit(
Expand Down

0 comments on commit 24e8c18

Please sign in to comment.