mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-17 04:35:14 +01:00
Postgres readyness check at one place in proxy instead of multiple
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
|
||||
. ./trace.sh
|
||||
|
||||
trace "[sqlmigrate20211105_0.7.0-0.8.0.sh] Waiting for PostgreSQL to be ready..."
|
||||
while [ ! -f "/container_monitor/postgres_ready" ]; do echo "PostgreSQL not ready" ; sleep 10 ; done
|
||||
trace "[sqlmigrate20211105_0.7.0-0.8.0.sh] PostgreSQL ready!"
|
||||
|
||||
trace "[sqlmigrate20211105_0.7.0-0.8.0.sh] Checking if postgres is set up..."
|
||||
psql -h postgres -U cyphernode -c "\d" | grep "cyphernode_props" > /dev/null
|
||||
if [ "$?" -eq "1" ]; then
|
||||
|
||||
@@ -34,13 +34,13 @@ else
|
||||
rm -f /container_monitor/proxy_dbfailed
|
||||
fi
|
||||
|
||||
trace "[startproxy] Waiting for PostgreSQL to be ready..."
|
||||
while [ ! -f "/container_monitor/postgres_ready" ]; do echo "PostgreSQL not ready" ; sleep 10 ; done
|
||||
trace "[startproxy] PostgreSQL ready!"
|
||||
|
||||
if [ ! -e ${DB_FILE} ]; then
|
||||
trace "[startproxy] DB not found, creating..."
|
||||
cat cyphernode.sql | sqlite3 $DB_FILE
|
||||
|
||||
trace "[startproxy] Waiting for PostgreSQL to be ready..."
|
||||
while [ ! -f "/container_monitor/postgres_ready" ]; do echo "PostgreSQL not ready" ; sleep 10 ; done
|
||||
trace "[startproxy] PostgreSQL ready!"
|
||||
psql -h postgres -f cyphernode.postgresql -U cyphernode
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
|
||||
Reference in New Issue
Block a user