瀏覽代碼

stop even using pooled DBs in peewee

perf3ct 10 月之前
父節點
當前提交
5c655f298b
共有 1 個文件被更改,包括 4 次插入16 次删除
  1. 4 16
      backend/apps/webui/internal/wrappers.py

+ 4 - 16
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