From e1444a9b00a573d9a7649836c21ba6e985c71e2d Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 13 Jun 2019 12:57:47 -0700 Subject: [PATCH] Add curl retries --- metrics/scripts/status.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/metrics/scripts/status.sh b/metrics/scripts/status.sh index 727995c44a..5d5868af50 100755 --- a/metrics/scripts/status.sh +++ b/metrics/scripts/status.sh @@ -23,12 +23,17 @@ source lib/config.sh docker ps --no-trunc --size ) -if ! timeout 10s curl -v --head http://localhost:8086/ping; then + +curl_head() { + curl --retry 5 --retry-delay 2 --retry-connrefused -v --head "$1" +} + +if ! curl_head http://localhost:8086/ping; then echo Error: InfluxDB not running exit 1 fi -if ! timeout 10s curl -v --head http://localhost:3000; then +if ! curl_head http://localhost:3000; then echo Error: Grafana not running exit 1 fi