Skip to content

Commit

Permalink
Release 14.0.1 (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkh authored Aug 24, 2023
2 parents b9c2103 + 52d7e8f commit 0abbacf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tdp_publicdb",
"description": "",
"version": "14.0.0",
"version": "14.0.1",
"author": {
"name": "The Caleydo Team",
"email": "[email protected]",
Expand Down Expand Up @@ -62,7 +62,7 @@
"react-select-async-paginate": "^0.5.3",
"react-select-event": "^5.5.1",
"react-virtualized": "^9.22.3",
"tdp_core": "^20.1.0",
"tdp_core": "^20.1.1",
"visyn_scripts": "^4.1.0"
},
"resolutions": {
Expand Down
17 changes: 15 additions & 2 deletions tdp_publicdb/settings.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
from pydantic import BaseModel
import contextlib
import json

from pydantic import BaseModel, validator
from visyn_core import manager


class TDPPublicDBSettings(BaseModel):
dburl: str = "postgresql://publicdb:publicdb@publicdb:5432/publicdb"
statement_timeout: str = "'5min'"
statement_timeout_query: str = "set statement_timeout to {}"
engine: dict = {"pool_pre_ping": True}
engine: dict[str, str] | None = {"pool_pre_ping": True}
poolclass: str | None = "QueuePool" # "NullPool" | "QueuePool" | "StaticPool"

@validator("engine", pre=True)
def json_decode_headers(cls, v): # NOQA N805
# Manually parse JSON strings if they are coming from the env via `VISYN_CORE__...='{"...": ...}'`.
# See https://github.com/pydantic/pydantic/issues/831 for details.
if isinstance(v, str):
with contextlib.suppress(ValueError):
return json.loads(v)
return v


def get_settings() -> TDPPublicDBSettings:
Expand Down

0 comments on commit 0abbacf

Please sign in to comment.