remove flag

This commit is contained in:
vbarda
2024-08-07 12:25:34 -04:00
parent 51b62ca0bd
commit 54da68cfe7
2 changed files with 0 additions and 14 deletions
@@ -24,8 +24,6 @@ from langgraph.checkpoint.serde.base import SerializerProtocol
class PostgresSaver(BasePostgresSaver):
lock: threading.Lock
is_setup: bool
def __init__(
self,
conn: Connection,
@@ -36,7 +34,6 @@ class PostgresSaver(BasePostgresSaver):
self.conn = conn
self.pipe = pipe
self.lock = threading.Lock()
self.is_setup = False
@classmethod
@contextmanager
@@ -68,8 +65,6 @@ class PostgresSaver(BasePostgresSaver):
already exist. It is called automatically when needed and should not be called
directly by the user.
"""
if self.is_setup:
return
with self.lock:
with self.conn.cursor(binary=True) as cur:
try:
@@ -87,8 +82,6 @@ class PostgresSaver(BasePostgresSaver):
if self.pipe:
self.pipe.sync()
self.is_setup = True
def list(
self,
config: Optional[RunnableConfig],
@@ -22,8 +22,6 @@ from langgraph.checkpoint.serde.base import SerializerProtocol
class AsyncPostgresSaver(BasePostgresSaver):
lock: asyncio.Lock
is_setup: bool
def __init__(
self,
conn: AsyncConnection,
@@ -34,7 +32,6 @@ class AsyncPostgresSaver(BasePostgresSaver):
self.conn = conn
self.pipe = pipe
self.lock = asyncio.Lock()
self.is_setup = False
@classmethod
@asynccontextmanager
@@ -66,8 +63,6 @@ class AsyncPostgresSaver(BasePostgresSaver):
already exist. It is called automatically when needed and should not be called
directly by the user.
"""
if self.is_setup:
return
async with self.lock:
async with self.conn.cursor(binary=True) as cur:
try:
@@ -89,8 +84,6 @@ class AsyncPostgresSaver(BasePostgresSaver):
if self.pipe:
await self.pipe.sync()
self.is_setup = True
async def alist(
self,
config: Optional[RunnableConfig],