Skip to content

Commit

Permalink
tile-pregeneration: Wait for envoy to get ready
Browse files Browse the repository at this point in the history
Bug: T295290
Change-Id: Iec3f032afce552d5fbbd94c11f70f0f8a3f52a8b
  • Loading branch information
johngian committed Nov 9, 2021
1 parent 104e0b5 commit 315a58e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/pregenerate-maps-tiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ TILELIST_PATH=${TEGOLA_TILELIST_DIR:-$TMP_DIR}/tilelist.txt
DEQUEUE_TIMEOUT=${TEGOLA_PREGENERATION_DEQUEUE_TIMEOUT:-60}
CACHE_OPERATION=${TEGOLA_CACHE_OPERATION:-"seed"}
ENVOY_ADMIN_ENDPOINT=${ENVOY_ADMIN_ENDPOINT:-"127.0.0.1:1666"}
ENVOY_HEALTHCHECK_ENDPOINT=${ENVOY_HEALTHCHECK_ENDPOINT:-"127.0.0.1:9361/healthz"}
ENVOY_HEALTHCHECK_MAX_RETRIES=${ENVOY_HEALTHCHECK_MAX_RETRIES:-5}

set -xv

Expand All @@ -39,6 +41,17 @@ exit_envoy() {

trap exit_envoy EXIT

# Wait for envoy sidecar to get ready
while [ "$(curl -m 5 -s -o /dev/null -w '%{http_code}' $ENVOY_HEALTHCHECK_ENDPOINT)" != "200" ]; do
sleep 5
((ENVOY_HEALTHCHECK_MAX_RETRIES--))
if [ "$ENVOY_HEALTHCHECK_MAX_RETRIES" -le 0 ]; then
echo "Envoy not ready"
exit 1
fi
echo "Retrying envoy healthcheck"
done

while true;
do
# Dequeue a message from the queue and store tiles in tilelist
Expand Down

0 comments on commit 315a58e

Please sign in to comment.