siftlode/backend/app
npeter83 6dece18ae8 fix(plex): image proxy no longer exhausts the DB connection pool
A collections page fires 100+ concurrent poster requests. Both image proxies
(/image and /person-image) authenticated via current_user + Depends(get_db),
holding a pooled DB connection for the whole request — including the slow Plex/
CDN fetch. Under the burst, the 15-connection pool was exhausted → QueuePool
checkout timeouts → 502s → slow, partially-loaded grids on prod.

Fix: authenticate these two high-fan-out endpoints with a signed-session check
(no DB user-load), serve disk-cache hits with zero DB access, and on a cold miss
open a short session only to resolve the image key + Plex config, releasing it
BEFORE the fetch (image_bytes uses no DB). Also raise the pool (20 + 30 overflow)
as headroom above the sync-endpoint threadpool.
2026-07-06 07:14:28 +02:00
..
downloads fix(downloads): prefer H.264+AAC for mp4 so shared files play on iOS/Safari 2026-07-04 17:29:05 +02:00
plex feat(plex): collections — sync, browse, filter, and info-page strips (Phase 1, read) 2026-07-06 02:25:48 +02:00
routes fix(plex): image proxy no longer exhausts the DB connection pool 2026-07-06 07:14:28 +02:00
static chore: rebrand Subfeed -> Siftlode 2026-06-14 04:40:22 +02:00
sync fix(titles): normalize titles at stub insert too (RSS/backfill/live-search) 2026-07-03 03:19:00 +02:00
youtube chore: prepare repo for public release — scrub internal infra, rewrite README 2026-07-01 12:46:50 +02:00
__init__.py feat: M1 foundation — compose stack, FastAPI, Google OAuth, encrypted tokens 2026-06-11 01:01:37 +02:00
auth.py fix(auth): /api/me answers 200 when logged out (no console error) 2026-07-04 18:17:24 +02:00
config.py chore(plex): use a generic example IP in the Plex server-URL hint (public repo) 2026-07-05 06:27:13 +02:00
db.py fix(plex): image proxy no longer exhausts the DB connection pool 2026-07-06 07:14:28 +02:00
email.py chore: rename remaining subfeed references to siftlode 2026-06-21 06:53:12 +02:00
main.py feat(plex): P0 backend foundations — catalog model, config, client 2026-07-05 01:35:08 +02:00
models.py feat(plex): collections — sync, browse, filter, and info-page strips (Phase 1, read) 2026-07-06 02:25:48 +02:00
notifications.py feat(notifications): durable per-user inbox (P1) + maintenance schema 2026-06-18 03:20:17 +02:00
progress.py feat(scheduler): admin run-now/run-all triggers + live progress + completion notices 2026-06-18 04:01:10 +02:00
quota.py feat(channels): channel-explore backend — about metadata, ephemeral provenance, cleanup 2026-06-30 02:52:44 +02:00
ratelimit.py feat(demo): demo-account schema + reusable rate limiter 2026-06-16 09:17:14 +02:00
realtime.py feat(messages): end-to-end encrypted real-time direct messaging backend 2026-06-25 22:05:35 +02:00
scheduler.py feat(plex): P1 backend — catalog sync + browse/search/show/image API 2026-07-05 02:20:23 +02:00
security.py refactor(auth): centralize token hashing, email validation & admin gating 2026-06-26 03:15:36 +02:00
state.py refactor(auth): centralize token hashing, email validation & admin gating 2026-06-26 03:15:36 +02:00
sysconfig.py feat(plex): P1 backend — catalog sync + browse/search/show/image API 2026-07-05 02:20:23 +02:00
titles.py feat(titles): normalize video titles for display (feed, search, downloads) 2026-07-03 03:00:08 +02:00
utils.py refactor(auth): centralize token hashing, email validation & admin gating 2026-06-26 03:15:36 +02:00
worker.py feat(downloads): store + show a canonical "downloaded from" source URL 2026-07-04 21:25:37 +02:00