Перенести решение лабораторной 1 как основу для лабораторной 2

This commit is contained in:
2026-10-06 11:54:05 +03:00
parent 65003b6119
commit 5c3f2bfad0
54 changed files with 4472 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
# Waits until GET /health/ready answers 200 or the attempt budget runs out.
# Usage: BASE_URL=http://localhost:8080 ATTEMPTS=60 sh student-tests/wait-ready.sh
set -eu
BASE_URL=${BASE_URL:-http://localhost:8080}
ATTEMPTS=${ATTEMPTS:-60}
i=0
while [ "$i" -lt "$ATTEMPTS" ]; do
if curl -sf "$BASE_URL/health/ready" >/dev/null 2>&1; then
echo "ready: $BASE_URL"
exit 0
fi
i=$((i + 1))
sleep 0.5
done
echo "not ready after $ATTEMPTS attempts: $BASE_URL" >&2
exit 1