This commit is contained in:
2026-11-06 18:09:01 +03:00
parent 0ab3a341aa
commit 8f89c7c43b
68 changed files with 4432 additions and 29 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
# Restart API and every state store without deleting volumes.
#
# Used by make test-persistence. Sessions live in Valkey with AOF and users,
# chats and messages in PostgreSQL, so the same bearer token and data survive.
set -eu
stack=${STACK_NAME:-lab3}
for service in "${stack}_postgres" "${stack}_valkey" "${stack}_api"; do
printf 'restarting %s\n' "$service"
docker service update --force "$service" >/dev/null
done
i=0
while [ "$i" -lt 60 ]; do
if curl -fsS "http://127.0.0.1:${APP_PORT:-8080}/health/ready" >/dev/null 2>&1; then
printf 'stack ready after restart\n'
exit 0
fi
i=$((i + 1))
sleep 2
done
printf 'stack did not become ready within 120s\n' >&2
exit 1