Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

feat: add timeout to null pool (#2549)

cthomasfa9b27b1912e
diff --git a/letta/server/db.py b/letta/server/db.py
index 1e9a94633..ba2f6b4e6 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