mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-27 16:10:30 +08:00
increase db pool size
This commit is contained in:
@@ -166,6 +166,9 @@ class Settings(BaseSettings):
|
||||
DATABASE_URI: Optional[PostgresDsn] = None
|
||||
DATABASE_MAX_TX_RETRY_COUNT: int = 3
|
||||
|
||||
DATABASE_POOL_SIZE = 128
|
||||
DATABASE_MAX_OVERFLOW = 128
|
||||
|
||||
RATE_LIMIT: bool = True
|
||||
MESSAGE_SIZE_LIMIT: int = 2000
|
||||
REDIS_HOST: str = "localhost"
|
||||
|
||||
@@ -5,4 +5,10 @@ from sqlmodel import create_engine
|
||||
if settings.DATABASE_URI is None:
|
||||
raise OasstError("DATABASE_URI is not set", error_code=OasstErrorCode.DATABASE_URI_NOT_SET)
|
||||
|
||||
engine = create_engine(settings.DATABASE_URI, echo=settings.DEBUG_DATABASE_ECHO, isolation_level="REPEATABLE READ")
|
||||
engine = create_engine(
|
||||
settings.DATABASE_URI,
|
||||
echo=settings.DEBUG_DATABASE_ECHO,
|
||||
isolation_level="REPEATABLE READ",
|
||||
pool_size=settings.DATABASE_POOL_SIZE,
|
||||
max_overflow=settings.DATABASE_MAX_OVERFLOW,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user