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
+16
View File
@@ -0,0 +1,16 @@
"""Издатель заданий процесса API.
Создаётся при импорте по `settings.broker`, соединение открывает первая
публикация: без брокера процесс стартует. Импортируют модуль только
`src/main.py` (закрытие в lifespan) и `src/api/dependencies.py`. Очередь — по
имени базы из `settings.database`: `make test_isolated` с базой `test_<db>` не
смешивается с рабочей.
"""
from src.config import settings
from src.infra.broker.client import create_job_publisher
job_publisher = create_job_publisher(
settings.broker,
namespace=settings.database.name,
)