Разбить API на модули и перевести комментарии на русский

This commit is contained in:
celis
2026-10-29 22:26:25 +03:00
parent c4f9eb7648
commit e8ba028b89
29 changed files with 630 additions and 456 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
#!/bin/sh
# Stops exactly the API replica whose X-Instance-Id is TARGET_INSTANCE_ID and leaves it stopped.
# X-Instance-Id = container hostname = first 12 hex chars of the container ID.
# Restore afterwards: docker compose start api
# Останавливает ровно ту API-реплику, чей X-Instance-Id передан в TARGET_INSTANCE_ID, и оставляет её остановленной.
# X-Instance-Id = hostname контейнера = первые 12 hex-символов ID контейнера.
# Восстановление после теста: docker compose start api
set -eu
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
cd "$(dirname "$0")/.."
@@ -10,5 +10,5 @@ case "$TARGET_INSTANCE_ID" in
esac
ids=$(docker compose ps -q api | grep "^$TARGET_INSTANCE_ID" || true)
[ "$(printf '%s\n' "$ids" | grep -c .)" -eq 1 ] || { echo "no single running api container for $TARGET_INSTANCE_ID" >&2; exit 1; }
docker stop "$ids" >/dev/null # SIGTERM -> readiness 503 -> drain -> exit (about 3 s)
docker stop "$ids" >/dev/null # SIGTERM → readiness 503 → drain → выход (около 3 с)
echo "stopped $(docker inspect -f '{{.Name}}' "$ids") ($TARGET_INSTANCE_ID)"