Отделить приём вложений от обработки через очередь и worker.

This commit is contained in:
samsik
2026-11-20 01:30:00 +03:00
parent 276dbdad8a
commit b92fa218ba
40 changed files with 4054 additions and 33 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
set -eu
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID is required}"
cd "$(dirname "$0")/.."
found=""
for cid in $(docker compose --env-file .env -f compose.yaml ps -q api); do
host=$(docker inspect -f '{{.Config.Hostname}}' "$cid")
short=$(printf '%s' "$cid" | cut -c1-12)
if [ "$host" = "$TARGET_INSTANCE_ID" ] || [ "$short" = "$TARGET_INSTANCE_ID" ]; then
found=$cid
break
fi
done
if [ -z "$found" ]; then
echo "API replica was not found" >&2
exit 1
fi
# docker stop оставляет реплику выключенной: restart policy unless-stopped.
docker stop -t 8 "$found" >/dev/null