Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
biplamal committed Dec 10, 2024
2 parents 0fad91a + cab1ecd commit 81bfc65
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions do.sh
Original file line number Diff line number Diff line change
Expand Up @@ -586,21 +586,25 @@ gen_openconfig_models_sdk() {
}
wait_for_sock() {
start=$SECONDS
TIMEOUT_SECONDS=30
if [ ! -z "${3}" ]
then
TIMEOUT_SECONDS=${3}
fi
echo "Waiting for ${1}:${2} to be ready (timeout=${TIMEOUT_SECONDS}s)..."
elapsed=0
TIMEOUT_SECONDS=$(($TIMEOUT_SECONDS * 10))
while true
do
nc -z -v ${1} ${2} && return 0
elapsed=$(( SECONDS - start ))
elapsed=$(($elapsed+1))
# echo "Timeout: $TIMEOUT_SECONDS"
# echo "elapsed time: $elapsed"
if [ $elapsed -gt ${TIMEOUT_SECONDS} ]
then
echo "${1}:${2} to be ready after ${TIMEOUT_SECONDS}s"
echo "${1}:${2} to be ready after ${TIMEOUT_SECONDS}"
exit 1
fi
sleep 0.1
Expand Down

0 comments on commit 81bfc65

Please sign in to comment.