Files
firefox-accounts-mirror/_scripts/check-url.sh
Bianca Danforth 67512368ad chore(scripts): increase check-url.sh RETRY value
Because:

* Mac M1 and M2 machines are slower to start up infrastructure like Redis and Firestore (which runs under emulation).

This commit:

* Doubles the RETRY period from 120 to 240s as most of the time, the __heartbeat__ response for fxa-auth-server and firestore processes responded between 140 - 190s.

Closes #No ticket
2023-09-06 10:59:27 -04:00

19 lines
406 B
Bash
Executable File

#!/bin/bash -e
echo "Checking for response from: $1"
RETRY=240
for i in $(eval echo "{1..$RETRY}"); do
if [ "$(curl -s -o /dev/null --silent -w "%{http_code}" http://$1)" == "${2:-200}" ]; then
echo "$1 responded in $SECONDS seconds"
exit 0
else
if [ "$i" -lt $RETRY ]; then
sleep 1
fi
fi
done
echo "Giving up after $SECONDS seconds. Failed to get response from: $1"
exit 1