Skip to content
Snippets Groups Projects
Commit a234fb04 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 0e46e68c
Branches
Tags
No related merge requests found
......@@ -73,7 +73,13 @@ echo ${DATABASEURL} >/etc/cta/cta-catalogue.conf
if [ "$KEEP_DATABASE" == "0" ]; then
echo "Wiping database"
if [ "$DATABASETYPE" != "sqlite" ]; then
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"
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"
fi
else
rm -fr $(dirname $(echo ${DATABASEURL} | cut -d: -f2))
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment