File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ urlsConfig="public/urls.cfg"
1414echo " Reading $urlsConfig "
1515while IFS=' =' read -r key url
1616do
17+ # Skip empty lines and invalid entries
18+ key=" $( echo " ${key:- } " | xargs) "
19+ url=" $( echo " ${url:- } " | xargs) "
20+ if [ -z " $key " ] || [ -z " $url " ]; then
21+ continue
22+ fi
1723 echo " $key =$url "
1824 KEYSARRAY+=(" $key " )
1925 URLSARRAY+=(" $url " )
6773 # Check service status
6874 for i in {1..3}
6975 do
70- response=$( curl -o /dev/null -s -w ' %{http_code} %{time_total}' --silent --output /dev/null " $url " )
76+ # Timeouts prevent long hangs from making the workflow exceed the schedule interval.
77+ # - connect-timeout: max seconds to establish connection
78+ # - max-time: max total seconds for the request
79+ response=$( curl --connect-timeout 5 --max-time 15 -o /dev/null -s -w ' %{http_code} %{time_total}' --silent --output /dev/null " $url " )
7180 http_code=$( echo " $response " | cut -d ' ' -f 1)
7281 time_total=$( echo " $response " | cut -d ' ' -f 2)
7382 echo " $http_code $time_total "
You can’t perform that action at this time.
0 commit comments