Merge branch 'improvement/ping_db' of https://github.com/MaxJa4/recipes into improvement/ping_db
This commit is contained in:
2
boot.sh
2
boot.sh
@ -6,7 +6,7 @@ echo "Waiting for database to be ready..."
|
|||||||
attempt=0
|
attempt=0
|
||||||
max_attempts=20
|
max_attempts=20
|
||||||
while pg_isready --host=${POSTGRES_HOST} -q; status=$?; attempt=$((attempt+1)); [ $status -ne 0 ] && [ $attempt -le $max_attempts ]; do
|
while pg_isready --host=${POSTGRES_HOST} -q; status=$?; attempt=$((attempt+1)); [ $status -ne 0 ] && [ $attempt -le $max_attempts ]; do
|
||||||
sleep 5 # no echo needed, response comes from pg_isready already
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $attempt -gt $max_attempts ]; then
|
if [ $attempt -gt $max_attempts ]; then
|
||||||
|
Reference in New Issue
Block a user