From 5c655f298b6b692dc936eae0e81f39bd174e54b6 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Mon, 17 Jun 2024 09:56:31 -0700 Subject: [PATCH] stop even using pooled DBs in peewee --- backend/apps/webui/internal/wrappers.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/backend/apps/webui/internal/wrappers.py b/backend/apps/webui/internal/wrappers.py index 4285efd21..e90e9860f 100644 --- a/backend/apps/webui/internal/wrappers.py +++ b/backend/apps/webui/internal/wrappers.py @@ -22,23 +22,11 @@ class PeeweeConnectionState(object): def register_connection(db_url): db = connect(db_url) if isinstance(db, PostgresqlDatabase): - db = PooledPostgresqlExtDatabase( - db.database, - max_connections=8, - stale_timeout=300, - timeout=None, - autoconnect=True, - **db.connect_params - ) + # Directly use PostgresqlDatabase without pooling + db.autoconnect = True elif isinstance(db, SqliteDatabase): - db = PooledSqliteDatabase( - db.database, - max_connections=8, - stale_timeout=300, - timeout=None, - autoconnect=True, - **db.connect_params - ) + # Directly use SqliteDatabase without pooling + db.autoconnect = True else: raise ValueError('Unsupported database connection') return db \ No newline at end of file