Skip to content
Snippets Groups Projects
Commit 984888bb authored by Bartek Wrona's avatar Bartek Wrona
Browse files

wait-for-postgres.sh uses dedicated SQL function exposed by HAF, to verify instance ready state.

parent 241e654f
No related branches found
No related tags found
2 merge requests!584Changes to be delivered to master as 1.27 release,!558Merge develop-haf with current develop
......@@ -9,8 +9,8 @@ DATABASE_URL=$1
wait_for_postgres() {
echo "Waiting for postgres hosted by container at the URL: ${DATABASE_URL}."
timeout $LIMIT bash -c "until psql "${DATABASE_URL}" -c 'SELECT * FROM hive.contexts;'; do sleep 3 ; done"
timeout $LIMIT bash -c "until psql "${DATABASE_URL}" -c 'SELECT NOT EXISTS(SELECT 1 FROM hive.indexes_constraints);'; do sleep 3 ; done"
timeout $LIMIT bash -c "until psql \"${DATABASE_URL}\" -c \"SELECT hive.wait_for_ready_instance('4 MIN'::interval);\" ; do sleep 3 ; done"
}
wait_for_postgres
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment