Files
breakpilot-lehrer/scripts/wait-for-core.sh
Benjamin Boenisch 5a31f52310 Initial commit: breakpilot-lehrer - Lehrer KI Platform
Services: Admin-Lehrer, Backend-Lehrer, Studio v2, Website,
Klausur-Service, School-Service, Voice-Service, Geo-Service,
BreakPilot Drive, Agent-Core

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 23:47:26 +01:00

24 lines
844 B
Bash

#!/bin/bash
# =========================================================
# wait-for-core.sh — Wait for Core infrastructure
# =========================================================
# Used by lehrer/compliance docker-compose as init container
MAX_RETRIES=${MAX_RETRIES:-60}
RETRY_INTERVAL=${RETRY_INTERVAL:-5}
HEALTH_URL=${HEALTH_URL:-http://bp-core-health:8099/health}
echo "Waiting for Core infrastructure at $HEALTH_URL ..."
for i in $(seq 1 $MAX_RETRIES); do
if curl -sf --max-time 3 "$HEALTH_URL" > /dev/null 2>&1; then
echo "Core infrastructure is ready! (attempt $i)"
exit 0
fi
echo " Attempt $i/$MAX_RETRIES — Core not ready yet, retrying in ${RETRY_INTERVAL}s..."
sleep $RETRY_INTERVAL
done
echo "ERROR: Core infrastructure did not become ready after $((MAX_RETRIES * RETRY_INTERVAL))s"
exit 1