Files
mtusi2026lab3/scripts/restart.sh
T
Alexey BodanyukandClaude Opus 5.5 4f6cfda37a chore: перенос решения lab2 (src, миграции, student-tests, Dockerfile, compose, lock) без изменений
Исходная точка lab3: код из solution/bvt2302-bodanyuk лабы 2, коммит ef44e48
(PR mtusi2026/mtusi2026lab2#42 принят). README, COURSE, contracts/ и tests/
преподавателя не тронуты; к Makefile дописан студенческий раздел lab2,
.env.example — версия lab2. Исследование трека 2 lab2 (bench/track2) не переносилось.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 13:02:13 +03:00

16 lines
760 B
Bash
Executable File

#!/bin/sh
# Restart hook for `make test-persistence ACTION_SCRIPT=scripts/restart.sh`.
# Restarts the API and ALL state stores (PostgreSQL, Valkey) of compose.yaml.
# Volumes, schema and data are preserved: no `down -v`, no FLUSH, no re-seed.
# Output is suppressed by the test; run it by hand to see the steps.
set -eu
cd "$(dirname "$0")/.."
# 1. API first: no request is served while the stores restart underneath it.
docker compose stop api
# 2. Stores: clean shutdown (PostgreSQL checkpoint, Valkey AOF fsync), then start again.
docker compose restart postgres valkey
# 3. API again; it waits for healthy stores via depends_on and reconnects its pool.
docker compose start api
echo "restart.sh: api, postgres and valkey restarted with volumes preserved"