refactor(db)!: finalize pooled WNDB v2 migration
This commit is contained in:
@@ -11,6 +11,7 @@ from app.core.config import settings
|
||||
from app.infra.db.project_routing import get_project_timescale_pgconn_string
|
||||
|
||||
|
||||
_check_connection = ConnectionPool.check_connection
|
||||
_pools: OrderedDict[str, ConnectionPool] = OrderedDict()
|
||||
_pool_conninfo: dict[str, str] = {}
|
||||
_pool_borrows: dict[str, int] = {}
|
||||
@@ -49,6 +50,7 @@ def get_timescale_pool(db_name: str) -> ConnectionPool:
|
||||
min_size=settings.PROJECT_TS_POOL_MIN_SIZE,
|
||||
max_size=settings.PROJECT_TS_POOL_MAX_SIZE,
|
||||
kwargs={"row_factory": dict_row},
|
||||
check=_check_connection,
|
||||
open=True,
|
||||
)
|
||||
_pools[db_name] = pool
|
||||
|
||||
Reference in New Issue
Block a user