Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G3-374: update the Geneweaver api db connection configuration #96

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <alexander.berger@jax.org>",
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
Loading