chore: align local-up.sh with spec

This commit is contained in:
2026-07-06 17:41:43 +08:00
parent 285edf9927
commit 397b9994d7

View File

@@ -13,31 +13,29 @@ RETRY_COUNT=0
until docker exec mci-mysql mysql -uroot -proot -e "SELECT 1" > /dev/null 2>&1; do until docker exec mci-mysql mysql -uroot -proot -e "SELECT 1" > /dev/null 2>&1; do
RETRY_COUNT=$((RETRY_COUNT + 1)) RETRY_COUNT=$((RETRY_COUNT + 1))
if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then 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 exit 1
fi fi
sleep 1 sleep 1
done done
echo "Waiting for Redis..." echo "Waiting for Redis..."
MAX_RETRIES=30
RETRY_COUNT=0 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)) RETRY_COUNT=$((RETRY_COUNT + 1))
if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then if [ "$RETRY_COUNT" -ge 30 ]; then
echo "Error: Redis did not become ready within ${MAX_RETRIES} seconds." >&2 echo "Redis did not become ready within 30 seconds."
exit 1 exit 1
fi fi
sleep 1 sleep 1
done done
echo "Waiting for RabbitMQ..." echo "Waiting for RabbitMQ..."
MAX_RETRIES=30
RETRY_COUNT=0 RETRY_COUNT=0
until curl -s -o /dev/null -w "%{http_code}" http://guest:guest@localhost:15672/api/overview | grep -q "200"; do 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)) RETRY_COUNT=$((RETRY_COUNT + 1))
if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then if [ "$RETRY_COUNT" -ge 30 ]; then
echo "Error: RabbitMQ did not become ready within ${MAX_RETRIES} seconds." >&2 echo "RabbitMQ did not become ready within 30 seconds."
exit 1 exit 1
fi fi
sleep 1 sleep 1