Skip to content

Commit

Permalink
Merge pull request #96 from TheJacksonLaboratory/G3-374-update-the-ge…
Browse files Browse the repository at this point in the history
…neweaver-api-db-connection-configuration

G3-374: update the Geneweaver api db connection configuration
  • Loading branch information
bergsalex authored Sep 9, 2024
2 parents 1370d9c + 2142d51 commit aadb58b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "geneweaver-api"
version = "0.8.1a1"
version = "0.8.1a2"
description = "The Geneweaver API"
authors = [
"Alexander Berger <[email protected]>",
Expand Down
5 changes: 5 additions & 0 deletions src/geneweaver/api/core/config_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 4 additions & 0 deletions src/geneweaver/api/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit aadb58b

Please sign in to comment.