chore: allow DATABASE_URL env to take presedence over individual connection params. (#1147)
fixes: #1147 Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
This commit is contained in:
parent
31c07771e8
commit
fe3cb76a19
1 changed files with 8 additions and 2 deletions
|
@ -8,8 +8,14 @@ rm -rf /app/tmp/cache/*
|
|||
|
||||
echo "Waiting for postgres to become ready...."
|
||||
|
||||
PGPASSWORD=$POSTGRES_PASSWORD
|
||||
PSQL="pg_isready -h $POSTGRES_HOST -p 5432 -U $POSTGRES_USERNAME"
|
||||
# Let DATABASE_URL env take presedence over individual connection params.
|
||||
if [ -z "$DATABASE_URL" ]; then
|
||||
PGPASSWORD=$POSTGRES_PASSWORD
|
||||
PSQL="pg_isready -h $POSTGRES_HOST -p 5432 -U $POSTGRES_USERNAME"
|
||||
else
|
||||
PSQL="pg_isready -d $DATABASE_URL"
|
||||
fi
|
||||
|
||||
until $PSQL
|
||||
do
|
||||
sleep 2;
|
||||
|
|
Loading…
Reference in a new issue