Перенести мессенджер на PostgreSQL и сессии Redis.
Skeleton contracts / contracts (pull_request) Canceled after 0s

Сообщения должны переживать рестарт, а доступ идти через Bearer, а не X-User-Id. Трек 2 сравнивает план keyset-запроса и сверяет pg_restore.
This commit is contained in:
Mlvn
2026-10-14 22:47:08 +03:00
parent 65003b6119
commit 096c53ecdb
29 changed files with 3384 additions and 23 deletions
+42
View File
@@ -0,0 +1,42 @@
#!/bin/sh
# Показывает, что остановленный Redis или PostgreSQL даёт 503, а не успешный анонимный ответ.
# Контейнеры в конце снова запущены. Токены в вывод не попадают.
set -eu
ROOT=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)
cd "$ROOT"
BASE=${BASE_URL:-http://127.0.0.1:8080}
ready() {
curl -s -o /tmp/lab2-ready-body -w "%{http_code}" "$BASE/health/ready" || echo "curl_fail"
}
echo "ready_before=$(ready)"
echo "stop redis"
docker compose --env-file .env stop redis
sleep 1
echo "ready_redis_down=$(ready)"
echo "start redis"
docker compose --env-file .env start redis
for _ in 1 2 3 4 5 6 7 8 9 10; do
code=$(ready)
if [ "$code" = "200" ]; then
break
fi
sleep 1
done
echo "ready_redis_back=$code"
echo "stop postgres"
docker compose --env-file .env stop postgres
sleep 1
echo "ready_postgres_down=$(ready)"
echo "start postgres"
docker compose --env-file .env start postgres
for _ in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
code=$(ready)
if [ "$code" = "200" ]; then
break
fi
sleep 1
done
echo "ready_postgres_back=$code"