diff --git a/pyproject.toml b/pyproject.toml index a6e19d6..0fec20a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "geneweaver-api" -version = "0.8.1a1" +version = "0.8.1a2" description = "The Geneweaver API" authors = [ "Alexander Berger ", diff --git a/src/geneweaver/api/core/config_class.py b/src/geneweaver/api/core/config_class.py index 89fc38c..3209c86 100644 --- a/src/geneweaver/api/core/config_class.py +++ b/src/geneweaver/api/core/config_class.py @@ -35,6 +35,11 @@ def assemble_db_settings(self) -> Self: ) return self + DB_POOL_MIN_SIZE: int = 4 + DB_POOL_MAX_SIZE: int = 8 + DB_POOL_MAX_LIFETIME: int = 300 + DB_POOL_MAX_IDLE: int = 60 + AUTH_DOMAIN: str = "thejacksonlaboratory.auth0.com" AUTH_AUDIENCE: str = "https://cube.jax.org" AUTH_ALGORITHMS: List[str] = ["RS256"] diff --git a/src/geneweaver/api/dependencies.py b/src/geneweaver/api/dependencies.py index bc40faa..01167b8 100644 --- a/src/geneweaver/api/dependencies.py +++ b/src/geneweaver/api/dependencies.py @@ -39,6 +39,10 @@ async def lifespan(app: FastAPI) -> None: settings.DB.URI, connection_class=psycopg.Connection[DictRow], kwargs={"row_factory": dict_row}, + min_size=settings.DB_POOL_MIN_SIZE, + max_size=settings.DB_POOL_MAX_SIZE, + max_lifetime=settings.DB_POOL_MAX_LIFETIME, + max_idle=settings.DB_POOL_MAX_IDLE, ) app.pool.open() app.pool.wait()