We now wait for PostgreSQL to be ready to start the proxy

This commit is contained in:
kexkey
2021-12-01 10:51:57 -05:00
parent ef4cd781da
commit 66045234eb
3 changed files with 15 additions and 3 deletions

View File

@@ -37,6 +37,10 @@ fi
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}