mirror of
https://github.com/standardnotes/server
synced 2026-01-16 20:04:32 -05:00
chore: fix is-available script with a timeout
This commit is contained in:
@@ -3,9 +3,15 @@
|
||||
WAIT_FOR_URL="$1"
|
||||
shift
|
||||
|
||||
while ! (curl -s $WAIT_FOR_URL | grep "Welcome"); do
|
||||
echo "$WAIT_FOR_URL is unavailable yet - waiting for it to start"
|
||||
sleep 10
|
||||
attempt=0
|
||||
while [ $attempt -le 180 ]; do
|
||||
attempt=$(( $attempt + 1 ))
|
||||
echo "# Waiting for all services to be up (attempt: $attempt) ..."
|
||||
ping_api_gateway_result=`curl -s $WAIT_FOR_URL | grep "Welcome"`
|
||||
if [ "$?" -eq "0" ]; then
|
||||
sleep 2 # for warmup
|
||||
echo "# All services are up!"
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "$WAIT_FOR_URL is up. Proceeding to startup."
|
||||
|
||||
Reference in New Issue
Block a user