From 0232eef5b21d182565d8a9ac70c1c1f8a2c1450b Mon Sep 17 00:00:00 2001 From: cthomas Date: Fri, 30 May 2025 12:50:53 -0700 Subject: [PATCH] feat: add timeout to null pool (#2549) --- letta/server/db.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/letta/server/db.py b/letta/server/db.py index 1e9a9463..ba2f6b4e 100644 --- a/letta/server/db.py +++ b/letta/server/db.py @@ -164,17 +164,23 @@ class DatabaseRegistry: } ) if not is_async: - base_args["pool_use_lifo"] = settings.pool_use_lifo + base_args.update( + { + "pool_use_lifo": settings.pool_use_lifo, + "pool_timeout": settings.pg_pool_timeout, + } + ) elif is_async: # For asyncpg, statement_cache_size should be in connect_args base_args.update( { + "pool_timeout": settings.pg_pool_timeout, "connect_args": { "prepared_statement_name_func": lambda: f"__asyncpg_{uuid.uuid4()}__", "statement_cache_size": 0, "prepared_statement_cache_size": 0, - } + }, } ) return base_args