From 8351cb92cbc21e94e51af1adc49bb7cd194065e8 Mon Sep 17 00:00:00 2001 From: luciferlinx <129729795+luciferlinx101@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:00:39 +0530 Subject: [PATCH] Updated DB settings (#805) --- superagi/models/db.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/superagi/models/db.py b/superagi/models/db.py index d49b5793e..e711280ff 100644 --- a/superagi/models/db.py +++ b/superagi/models/db.py @@ -29,7 +29,13 @@ def connect_db(): db_url = f'postgresql://{db_username}:{db_password}@{database_url}/{db_name}' # Create the SQLAlchemy engine - engine = create_engine(db_url) + engine = create_engine(db_url, + pool_size=20, # Maximum number of database connections in the pool + max_overflow=50, # Maximum number of connections that can be created beyond the pool_size + pool_timeout=30, # Timeout value in seconds for acquiring a connection from the pool + pool_recycle=1800, # Recycle connections after this number of seconds (optional) + pool_pre_ping=False, # Enable connection health checks (optional) + ) # Test the connection try: