Skip to content

Commit d22093f

Browse files
committed
add max-time option to avoid unexpected hang
1 parent dbf1eb4 commit d22093f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

apollo-adminservice/src/main/scripts/startup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ declare -i max_counter=16 # 16*5=80s
6666
declare -i total_time=0
6767

6868
printf "Waiting for server startup" >> $STARTUP_LOG
69-
until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --head $SERVER_URL | grep "Coyote")" != "" ]];
69+
until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --max-time 2 --head $SERVER_URL | grep "Coyote")" != "" ]];
7070
do
7171
printf "." >> $STARTUP_LOG
7272
counter+=1

apollo-configservice/src/main/scripts/startup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ declare -i max_counter=16 # 16*5=80s
6666
declare -i total_time=0
6767

6868
printf "Waiting for server startup" >> $STARTUP_LOG
69-
until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --head $SERVER_URL | grep "Coyote")" != "" ]];
69+
until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --max-time 2 --head $SERVER_URL | grep "Coyote")" != "" ]];
7070
do
7171
printf "." >> $STARTUP_LOG
7272
counter+=1

apollo-portal/src/main/scripts/startup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ declare -i max_counter=16 # 16*5=80s
6666
declare -i total_time=0
6767

6868
printf "Waiting for server startup" >> $STARTUP_LOG
69-
until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --head $SERVER_URL | grep "Coyote")" != "" ]];
69+
until [[ (( counter -ge max_counter )) || "$(curl -X GET --silent --connect-timeout 1 --max-time 2 --head $SERVER_URL | grep "Coyote")" != "" ]];
7070
do
7171
printf "." >> $STARTUP_LOG
7272
counter+=1

0 commit comments

Comments
 (0)