fix: reduce db pool size to prevent connection exhaustion, sort grouped views by count

Pool was 20+10 overflow per engine; uvicorn --reload leaked pools until
Postgres hit max_connections=100. Reduced to 5+5 with pool_pre_ping.

Grouped views (tags, people, colors, rated) now sort cards largest-first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
root
2026-04-12 21:32:05 +02:00
parent d933ea3842
commit 03a4c75e3e
6 changed files with 17 additions and 5 deletions

View File

@@ -73,7 +73,9 @@ else:
settings.database_url,
echo=False,
pool_size=settings.performance.db_pool_size,
max_overflow=settings.performance.db_pool_max_overflow,
pool_recycle=settings.performance.db_pool_recycle,
pool_pre_ping=True,
)
# Create async session factory