1
0
Fork 0
mirror of https://github.com/Luzifer/mondash.git synced 2024-12-23 04:21:18 +00:00

Fix: Do not try to continue if error ocurred

This commit is contained in:
Knut Ahlers 2015-07-06 22:32:25 +02:00
parent d975f946de
commit b9e5281a87

View file

@ -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()
}