Use the postgres client to check if database is up.
This commit is contained in:
committed by
Abhilash Raj
parent
c7fee80c65
commit
e5dc77b558
@@ -15,13 +15,11 @@ function wait_for_postgres () {
|
|||||||
# moving forward.
|
# moving forward.
|
||||||
# TODO: Use python's psycopg2 module to do this in python instead of
|
# TODO: Use python's psycopg2 module to do this in python instead of
|
||||||
# installing postgres-client in the image.
|
# installing postgres-client in the image.
|
||||||
# until psql $DATABASE_URL -c '\l'; do
|
until psql $DATABASE_URL -c '\l'; do
|
||||||
# >&2 echo "Postgres is unavailable - sleeping"
|
>&2 echo "Postgres is unavailable - sleeping"
|
||||||
# sleep 1
|
sleep 1
|
||||||
# done
|
done
|
||||||
# >&2 echo "Postgres is up - continuing"
|
>&2 echo "Postgres is up - continuing"
|
||||||
sleep 5
|
|
||||||
# TODO: Just sleep and do not require postgres client for the image maybe.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user