mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-17 12:45:22 +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.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..."
|
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
|
psql -h postgres -U cyphernode -c "\d" | grep "cyphernode_props" > /dev/null
|
||||||
if [ "$?" -eq "1" ]; then
|
if [ "$?" -eq "1" ]; then
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ else
|
|||||||
rm -f /container_monitor/proxy_dbfailed
|
rm -f /container_monitor/proxy_dbfailed
|
||||||
fi
|
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
|
if [ ! -e ${DB_FILE} ]; then
|
||||||
trace "[startproxy] DB not found, creating..."
|
trace "[startproxy] DB not found, creating..."
|
||||||
cat cyphernode.sql | sqlite3 $DB_FILE
|
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
|
psql -h postgres -f cyphernode.postgresql -U cyphernode
|
||||||
returncode=$?
|
returncode=$?
|
||||||
trace_rc ${returncode}
|
trace_rc ${returncode}
|
||||||
|
|||||||
Reference in New Issue
Block a user