Browse Source

fix(health): set default curl connection timeout if not set (#13529)

Ilya Mashchenko 2 years ago
parent
commit
3838e0a6ce
1 changed files with 4 additions and 0 deletions
  1. 4 0
      health/notifications/alarm-notify.sh.in

+ 4 - 0
health/notifications/alarm-notify.sh.in

@@ -428,6 +428,10 @@ else
   done
 fi
 
+if [[ ! $curl_options =~ .*\--connect-timeout ]]; then
+  curl_options+=" --connect-timeout 5"
+fi
+
 OPSGENIE_API_URL=${OPSGENIE_API_URL:-"https://api.opsgenie.com"}
 
 # If we didn't autodetect the character set for e-mail and it wasn't