123456789101112131415161718192021222324252627282930313233 |
- #!/bin/bash
- try=1
- to=3
- start=0
- delay=5
- sleep "$start"
- while (( $try <= $to )); do
- echo "Checking health of postgres (try ${try} of ${to})..."
- if docker exec sentry_postgres pg_isready -U postgres; then
- break
- fi
- if (( $try == $to )); then
- echo "Exceeded retries."
- exit 1
- fi
- try=$(($try + 1))
- sleep "$delay"
- done
|