feat: process attachments asynchronously with RabbitMQ and a worker

Upload answers 202 after staging, a queued job in PostgreSQL and a broker
confirm; a separate worker publishes the original and a thumbnail with
bounded retries. Adds the job and variant tables, the broker service, the
worker S3 user, cleanup and reconcile support for staging and variants,
the failure stand with broker and worker, bench and driver updates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 06:48:20 +03:00
co-authored by Claude Opus 5.5
parent 40c709a78b
commit ff1a83b6ff
107 changed files with 9765 additions and 993 deletions
+11
View File
@@ -158,6 +158,17 @@ access_log=False)`. Импорты в `src/__main__.py` — внутри `if __n
`docker compose run --rm --no-deps cleaner --once`. Цели Makefile
нет: образ для него собирает `make run_docker`.
## Worker (с лабы 5)
`python -m src.worker` → `src/worker/__main__.py` → `early_stop.install("worker")`
→ `main()` (`worker.md`), в compose — сервис `worker`, PID 1. SIGTERM: новые
сообщения не берутся, начатые ждут ≤ `[worker] graceful_shutdown_seconds`,
остальные отменяются, «Stopped worker», код 0, `os._exit`: поток декодирования не
отменить. Сигнал на старте — «Stopped worker before startup». Неверные настройки —
код 2. Отказ брокера, S3, PostgreSQL процесс не роняет. Консоль — `make run_dev`
(поднимает и брокер) плюс `make run_worker` в другом терминале: тот же `.env`,
ключи worker в окружении процесса.
## Makefile
- Цели skeleton `help`, `check`, `validate`, `test`, `load`,