Добавить X-Instance-Id, обязательный Idempotency-Key и мягкую остановку API

This commit is contained in:
Pavel Grigorev
2026-11-12 19:45:14 +03:00
parent 0ab3a341aa
commit 291dfe65bf
20 changed files with 1087 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
docker compose stop api
docker compose restart postgres valkey
docker compose up -d --no-build --no-recreate --wait postgres valkey
docker compose start api
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
set -eu
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
cd "$(dirname "$0")/.."
for id in $(docker compose ps -q api); do
case "$id" in
"$TARGET_INSTANCE_ID"*)
docker stop -t 10 "$id" >/dev/null
exit 0
;;
esac
done
echo "no running api replica matches TARGET_INSTANCE_ID" >&2
exit 1