diff --git a/app/data/container-build/cerc-fixturenet-eth-geth/run-el.sh b/app/data/container-build/cerc-fixturenet-eth-geth/run-el.sh index edde1ba..9f6bf1f 100755 --- a/app/data/container-build/cerc-fixturenet-eth-geth/run-el.sh +++ b/app/data/container-build/cerc-fixturenet-eth-geth/run-el.sh @@ -64,8 +64,8 @@ else STATEDIFF_OPTS="" if [ "$CERC_RUN_STATEDIFF" == "true" ]; then ready=0 + echo "Waiting for statediff DB..." while [ $ready -eq 0 ]; do - echo "Waiting for statediff DB..." sleep 1 export PGPASSWORD="$CERC_STATEDIFF_DB_PASSWORD" result=$(psql -h "$CERC_STATEDIFF_DB_HOST" \ @@ -73,9 +73,13 @@ else -U "$CERC_STATEDIFF_DB_USER" \ -d "$CERC_STATEDIFF_DB_NAME" \ -t -c 'select max(version_id) from goose_db_version;' 2>/dev/null | awk '{ print $1 }') - if [ -n "$result" ] && [ $result -ge $CERC_STATEDIFF_DB_GOOSE_MIN_VER ]; then + if [ -n "$result" ]; then echo "DB ready..." - ready=1 + if [ $result -ge $CERC_STATEDIFF_DB_GOOSE_MIN_VER ]; then + ready=1 + else + echo "DB not at required version (want $CERC_STATEDIFF_DB_GOOSE_MIN_VER, have $result)" + fi fi done STATEDIFF_OPTS="--statediff=true \