Skip to content
Snippets Groups Projects
Commit 6e5c1de9 authored by Romain De Laage De Bellefaye's avatar Romain De Laage De Bellefaye
Browse files

Use pg_isready instead of a simple sleep 1 to be sure that the db is ready

parent 3997083a
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,11 @@ if [ "$1" = 'mattermost' ]; then ...@@ -68,7 +68,11 @@ if [ "$1" = 'mattermost' ]; then
# Wait another second for the database to be properly started. # Wait another second for the database to be properly started.
# Necessary to avoid "panic: Failed to open sql connection pq: the database system is starting up" # Necessary to avoid "panic: Failed to open sql connection pq: the database system is starting up"
sleep 1 until pg_isready -h $DB_HOST -p $DB_PORT_NUMBER
do
echo "Database is not ready yet. Waiting 5 seconds."
sleep 5
done
echo "Starting mattermost" echo "Starting mattermost"
fi fi
......
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