From b185efe36561d0bf62da3d29ed9dd3ceb6cf7822 Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Fri, 3 May 2024 11:38:18 -0700 Subject: [PATCH] Check if conn is alive (#381) --- langgraph/checkpoint/aiosqlite.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/langgraph/checkpoint/aiosqlite.py b/langgraph/checkpoint/aiosqlite.py index c9c4455ce..8db44b822 100644 --- a/langgraph/checkpoint/aiosqlite.py +++ b/langgraph/checkpoint/aiosqlite.py @@ -52,8 +52,8 @@ class AsyncSqliteSaver(BaseCheckpointSaver, AbstractAsyncContextManager): async def setup(self) -> None: if self.is_setup: return - - await self.conn + if not self.conn.is_alive(): + await self.conn async with self.conn.executescript( """ CREATE TABLE IF NOT EXISTS checkpoints (