Deploy Development / deploy (push) Successful in 23s
Anmeldung, Datenraeume, Akten, Vorgaenge, gemeinsame Notizen, Dateien, manuelle Paperless-Referenzen, Aufgaben und unabhaengige Fristen laufen damit in der Entwicklungsumgebung. Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
485 B
Python
20 lines
485 B
Python
"""Runtime connection pool. Importing the app does not open it."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from psycopg.rows import dict_row
|
|
from psycopg_pool import ConnectionPool
|
|
|
|
from app.core.settings import Settings
|
|
|
|
|
|
def open_pool(settings: Settings) -> ConnectionPool:
|
|
return ConnectionPool(
|
|
conninfo=settings.dsn(settings.db_runtime_user),
|
|
kwargs={"row_factory": dict_row},
|
|
min_size=1,
|
|
max_size=10,
|
|
open=True,
|
|
timeout=10,
|
|
)
|