Sha256: 5ca841c7ef4ba2a2e4a05db12ec996b947d9fbf6f22881826a2c48a4c7a17578

Contents?: true

Size: 803 Bytes

Versions: 28

Compression:

Stored size: 803 Bytes

Contents

#!/bin/sh

check_looker() {
  status=$(curl --silent --insecure --write "%{http_code}" \
    --data "client_id=$LOOKERSDK_CLIENT_ID&client_secret=$LOOKERSDK_CLIENT_SECRET"\
    $LOOKERSDK_BASE_URL/api/${LOOKERSDK_API_VERSION:-4.0}/login\
    -o /dev/null)
}

MAX_RETRIES=160
ATTEMPTS=1
status=0
check_looker
while [ $status -ne 200 ];
do
  RETRY_MSG="after $ATTEMPTS attempts: $MAX_RETRIES retries remaining."
  if [ $ATTEMPTS -ge $MAX_RETRIES ];
  then
    echo 'Looker took too long to start'
    exit 1
  else
    if [ $status -ne 0 ];
    then
      echo "Received status($status) from Looker $RETRY_MSG"
    else
      echo "Looker server connection rejected $RETRY_MSG"
    fi
  fi

  sleep 2
  ATTEMPTS=$(( $ATTEMPTS + 1 ))
  check_looker
done
echo "Looker ready after $ATTEMPTS attempts"
exit 0

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
gazer-0.3.18 .github/scripts/wait_for_looker.sh
gazer-0.3.17 .github/scripts/wait_for_looker.sh
gazer-0.3.16 .github/scripts/wait_for_looker.sh
gazer-0.3.15 .github/scripts/wait_for_looker.sh
gazer-0.3.14 .github/scripts/wait_for_looker.sh
gazer-0.3.13 .github/scripts/wait_for_looker.sh
gazer-0.3.12 .github/scripts/wait_for_looker.sh
gazer-0.3.11 .github/scripts/wait_for_looker.sh
gazer-0.3.10 .github/scripts/wait_for_looker.sh
gazer-0.3.9 .github/scripts/wait_for_looker.sh
gazer-0.3.8 .github/scripts/wait_for_looker.sh
gazer-0.3.7 .github/scripts/wait_for_looker.sh
gazer-0.3.6 .github/scripts/wait_for_looker.sh
gazer-0.3.5 .github/scripts/wait_for_looker.sh
gazer-0.3.4 .github/scripts/wait_for_looker.sh
gazer-0.3.3 .github/scripts/wait_for_looker.sh
gazer-0.3.2 .github/scripts/wait_for_looker.sh
gazer-0.3.1 .github/scripts/wait_for_looker.sh
gazer-0.3.0 .github/scripts/wait_for_looker.sh
gazer-0.2.60 .github/scripts/wait_for_looker.sh