From 397b9994d722f230dddc101eda84b310d9c600ec Mon Sep 17 00:00:00 2001 From: marsal Date: Mon, 6 Jul 2026 17:41:43 +0800 Subject: [PATCH] chore: align local-up.sh with spec --- scripts/local-up.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/local-up.sh b/scripts/local-up.sh index 61acf47..5f177e9 100755 --- a/scripts/local-up.sh +++ b/scripts/local-up.sh @@ -13,31 +13,29 @@ RETRY_COUNT=0 until docker exec mci-mysql mysql -uroot -proot -e "SELECT 1" > /dev/null 2>&1; do RETRY_COUNT=$((RETRY_COUNT + 1)) if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then - echo "Error: MySQL did not become ready within ${MAX_RETRIES} seconds." >&2 + echo "MySQL did not become ready within ${MAX_RETRIES} seconds." exit 1 fi sleep 1 done echo "Waiting for Redis..." -MAX_RETRIES=30 RETRY_COUNT=0 -until docker exec mci-redis redis-cli ping | grep -q "PONG"; do +until redis-cli -h localhost -p 6379 ping | grep -q "PONG"; do RETRY_COUNT=$((RETRY_COUNT + 1)) - if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then - echo "Error: Redis did not become ready within ${MAX_RETRIES} seconds." >&2 + if [ "$RETRY_COUNT" -ge 30 ]; then + echo "Redis did not become ready within 30 seconds." exit 1 fi sleep 1 done echo "Waiting for RabbitMQ..." -MAX_RETRIES=30 RETRY_COUNT=0 until curl -s -o /dev/null -w "%{http_code}" http://guest:guest@localhost:15672/api/overview | grep -q "200"; do RETRY_COUNT=$((RETRY_COUNT + 1)) - if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then - echo "Error: RabbitMQ did not become ready within ${MAX_RETRIES} seconds." >&2 + if [ "$RETRY_COUNT" -ge 30 ]; then + echo "RabbitMQ did not become ready within 30 seconds." exit 1 fi sleep 1