mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-16 08:25:18 +02:00
chore: update setup docs
This commit is contained in:
parent
15a7cd5b6d
commit
418775cee1
7 changed files with 457 additions and 39 deletions
|
|
@ -19,6 +19,10 @@ VENV_PATH="$BASE_DIR/venv"
|
|||
|
||||
LOG_TO_FILE=${LOG_TO_FILE:-true}
|
||||
|
||||
HEALTH_CHECK_ENDPOINT="/api/v1/health"
|
||||
HEALTH_MAX_ATTEMPTS=${HEALTH_MAX_ATTEMPTS:-30}
|
||||
HEALTH_INTERVAL=${HEALTH_INTERVAL:-2}
|
||||
|
||||
cd "$BASE_DIR"
|
||||
echo "Starting Dograh Services (DEV MODE) at $(date) in BASE_DIR: ${BASE_DIR}"
|
||||
echo "Auto-reload enabled for api/ directory changes"
|
||||
|
|
@ -193,7 +197,32 @@ for i in "${!SERVICE_NAMES[@]}"; do
|
|||
done
|
||||
|
||||
###############################################################################
|
||||
### 8) Summary
|
||||
### 8) Wait for uvicorn health check
|
||||
###############################################################################
|
||||
|
||||
echo "Waiting for uvicorn health check at http://127.0.0.1:${UVICORN_BASE_PORT}${HEALTH_CHECK_ENDPOINT} ..."
|
||||
|
||||
healthy=false
|
||||
for ((attempt = 1; attempt <= HEALTH_MAX_ATTEMPTS; attempt++)); do
|
||||
http_code=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
"http://127.0.0.1:${UVICORN_BASE_PORT}${HEALTH_CHECK_ENDPOINT}" 2>/dev/null || echo "000")
|
||||
|
||||
if [[ "$http_code" == "200" ]]; then
|
||||
echo "✓ uvicorn healthy (attempt $attempt)"
|
||||
healthy=true
|
||||
break
|
||||
fi
|
||||
sleep "$HEALTH_INTERVAL"
|
||||
done
|
||||
|
||||
if ! $healthy; then
|
||||
echo "✗ uvicorn FAILED health check after $HEALTH_MAX_ATTEMPTS attempts."
|
||||
echo " Check logs: tail -f $LOG_DIR/uvicorn.log"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
### 9) Summary
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue