From 1ba5059a3edadba072b5ebb3707736051ed6ea3a Mon Sep 17 00:00:00 2001 From: Jialin Zhang Date: Wed, 1 May 2024 15:26:00 -0700 Subject: [PATCH] fix ystore start flow --- pycrdt_websocket/ystore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycrdt_websocket/ystore.py b/pycrdt_websocket/ystore.py index f065ddb..9f568b4 100644 --- a/pycrdt_websocket/ystore.py +++ b/pycrdt_websocket/ystore.py @@ -343,7 +343,6 @@ async def start( task_status: The status to set when the task has started. """ - self.db_initialized = Event() if from_context_manager: assert self._task_group is not None self._task_group.start_soon(self._init_db) @@ -364,6 +363,7 @@ async def stop(self) -> None: if self.db_initialized.is_set(): await self._db.close() await super().stop() + self.db_initialized = Event() async def _init_db(self): create_db = False