Files
mtusi2026lab7/scripts/start-replicas.sh
T
sendormeco d15f2a3631
Application stack (lab7) / stack (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
7 — Т2302 — ебедев — на 5
2026-11-22 23:26:17 +03:00

17 lines
515 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# Восстанавливает остановленные API-реплики (после stop-one) и ждёт их healthcheck (≤60 с).
set -eu
. "$(dirname "$0")/lib.sh"
for cid in $(dc ps -a -q api); do docker start "$cid" >/dev/null; done
i=0
while [ $i -lt 120 ]; do
bad=0
for cid in $(dc ps -a -q api); do
[ "$(docker inspect -f '{{.State.Health.Status}}' "$cid")" = healthy ] || bad=1
done
[ $bad -eq 0 ] && break
i=$((i + 1)); sleep 0.5
done
state | grep '^api '
[ $bad -eq 0 ]