increase db pool size

This commit is contained in:
Andreas Köpf
2023-02-04 18:28:17 +01:00
parent b724b37d4c
commit effbde407a
2 changed files with 10 additions and 1 deletions
+3
View File
@@ -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"
+7 -1
View File
@@ -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,
)