mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
refac
This commit is contained in:
parent
38e8209d71
commit
aef0ad2d10
1 changed files with 16 additions and 17 deletions
|
|
@ -84,6 +84,7 @@ if "sqlite" in SQLALCHEMY_DATABASE_URL:
|
|||
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
|
||||
)
|
||||
else:
|
||||
if isinstance(DATABASE_POOL_SIZE, int):
|
||||
if DATABASE_POOL_SIZE > 0:
|
||||
engine = create_engine(
|
||||
SQLALCHEMY_DATABASE_URL,
|
||||
|
|
@ -94,14 +95,12 @@ else:
|
|||
pool_pre_ping=True,
|
||||
poolclass=QueuePool,
|
||||
)
|
||||
elif DATABASE_POOL_SIZE == 0:
|
||||
else:
|
||||
engine = create_engine(
|
||||
SQLALCHEMY_DATABASE_URL, pool_pre_ping=True, poolclass=NullPool
|
||||
)
|
||||
else:
|
||||
engine = create_engine(
|
||||
SQLALCHEMY_DATABASE_URL, pool_pre_ping=True
|
||||
)
|
||||
engine = create_engine(SQLALCHEMY_DATABASE_URL, pool_pre_ping=True)
|
||||
|
||||
|
||||
SessionLocal = sessionmaker(
|
||||
|
|
|
|||
Loading…
Reference in a new issue