Unverified Commit 5c655f29 authored by perf3ct's avatar perf3ct
Browse files

stop even using pooled DBs in peewee

parent 981866eb
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment