Commit 6b1ae872 authored by Oliver Keeble's avatar Oliver Keeble
Browse files

Add a pause/retry to init to wait for db to come up, needed for local postgres container

parent cb3bb486
......@@ -73,7 +73,13 @@ echo ${DATABASEURL} >/etc/cta/cta-catalogue.conf
if [ "$KEEP_DATABASE" == "0" ]; then
echo "Wiping database"
if [ "$DATABASETYPE" != "sqlite" ]; then
if ! (echo yes | cta-catalogue-schema-drop /etc/cta/cta-catalogue.conf); then
# pause to let db come up
echo "Database connection failed, pausing before a retry"
sleep 5
echo yes | cta-catalogue-schema-drop /etc/cta/cta-catalogue.conf || die "ERROR: Could not wipe database. cta-catalogue-schema-drop /etc/cta/cta-catalogue.conf FAILED"
echo "Database wiped"
rm -fr $(dirname $(echo ${DATABASEURL} | cut -d: -f2))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment