siftlode/backend/app/downloads
npeter83 7148335c09 feat(downloads): M3 — per-user quota + retention GC
- downloads/quota.py: per-user limits (DownloadQuota row or sysconfig defaults; unlimited
  bypass), footprint = distinct ready-asset bytes the user holds, check_enqueue (max_jobs +
  max_bytes hard at enqueue), at_concurrency_limit (worker-side max_concurrent), usage snapshot
- downloads/gc.py: run_download_gc — pre-expiry warning (once, gc_notified flag), TTL deletion
  (files + row; FK SET NULL orphans holders' jobs -> 'expired'), LRU eviction over a total-cache
  cap; notifies holders on each event
- migration 0038: media_assets.gc_notified
- config/sysconfig: download_total_max_bytes (0=unlimited) in the downloads group
- service.enqueue enforces quota; worker claim skips users at their concurrency limit
- scheduler: download_gc job registered (default 360 min, admin-tunable)

Verified on localdev: footprint accounting, max_jobs block, pre-expiry warning (notifies all
holders), TTL deletion (asset+files gone, dirs pruned, jobs orphaned, holders notified).
2026-07-03 00:26:40 +02:00
..
__init__.py fix(downloads): add the downloads package (was wrongly gitignored) + robust sanitizer 2026-07-03 00:19:22 +02:00
formats.py fix(downloads): add the downloads package (was wrongly gitignored) + robust sanitizer 2026-07-03 00:19:22 +02:00
gc.py feat(downloads): M3 — per-user quota + retention GC 2026-07-03 00:26:40 +02:00
quota.py feat(downloads): M3 — per-user quota + retention GC 2026-07-03 00:26:40 +02:00
service.py feat(downloads): M3 — per-user quota + retention GC 2026-07-03 00:26:40 +02:00
storage.py fix(downloads): add the downloads package (was wrongly gitignored) + robust sanitizer 2026-07-03 00:19:22 +02:00