From b9e5281a87e4677d5ac196ed812dbb5658f0ce46 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 6 Jul 2015 22:32:25 +0200 Subject: [PATCH] Fix: Do not try to continue if error ocurred --- welcome_runner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/welcome_runner.go b/welcome_runner.go index 1c0dcc3..a104341 100644 --- a/welcome_runner.go +++ b/welcome_runner.go @@ -25,10 +25,8 @@ func runWelcomePage(cfg *config.Config) { switch { case beers < 6: status = "Critical" - break case beers < 12: status = "Warning" - break } beer := dashboardMetric{ @@ -43,6 +41,7 @@ func runWelcomePage(cfg *config.Config) { body, err := json.Marshal(beer) if err != nil { log.Println(err) + continue } url := fmt.Sprintf("%s/welcome/beer_available", baseURL) req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(body)) @@ -50,6 +49,7 @@ func runWelcomePage(cfg *config.Config) { resp, err := http.DefaultClient.Do(req) if err != nil { log.Printf("[WelcomeRunner] %s", err) + continue } resp.Body.Close() }