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:
@@ -83,6 +83,38 @@ services:
|
||||
memory: ${BENCH_CLEANER_MEMORY:?run make bench}
|
||||
memswap_limit: ${BENCH_CLEANER_MEMORY:?run make bench}
|
||||
|
||||
# брокер (design change async-attachments, решение 16) запускает только
|
||||
# профиль uploads: образ, rabbitmq.conf и лимиты рабочего стенда, swap =
|
||||
# память, на прогон — новый volume. Прочие профили его не запускают:
|
||||
# старт стенда перечисляет сервисы, реплики — с --no-deps (depends_on api
|
||||
# не действует), а издатель API соединяется первой публикацией. Без порта
|
||||
# хоста, без перезапуска, под своим именем
|
||||
rabbitmq:
|
||||
container_name: mtusi-bench-rabbitmq
|
||||
restart: "no"
|
||||
ports: !reset []
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: ${BENCH_BROKER_CPUS:?run make bench}
|
||||
memory: ${BENCH_BROKER_MEMORY:?run make bench}
|
||||
memswap_limit: ${BENCH_BROKER_MEMORY:?run make bench}
|
||||
|
||||
# worker описан и не запускается ни одним профилем: стенд меряет реплику,
|
||||
# а не обработку, задания ждут в очереди. Образ стенда, без config.toml
|
||||
# рабочего стенда; лимиты BENCH_WORKER_* compose требует при разборе
|
||||
worker:
|
||||
container_name: mtusi-bench-worker
|
||||
image: mtusi-messenger:bench
|
||||
restart: "no"
|
||||
volumes: !reset []
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: ${BENCH_WORKER_CPUS:?run make bench}
|
||||
memory: ${BENCH_WORKER_MEMORY:?run make bench}
|
||||
memswap_limit: ${BENCH_WORKER_MEMORY:?run make bench}
|
||||
|
||||
migrate:
|
||||
image: mtusi-messenger:bench
|
||||
# без config.toml рабочего стенда: настройки — окружение и дефолты
|
||||
|
||||
Reference in New Issue
Block a user