mirror of
https://github.com/Luzifer/mondash.git
synced 2024-11-10 00:20:02 +00:00
Fix: Do not try to continue if error ocurred
This commit is contained in:
parent
d975f946de
commit
b9e5281a87
1 changed files with 2 additions and 2 deletions
|
@ -25,10 +25,8 @@ func runWelcomePage(cfg *config.Config) {
|
||||||
switch {
|
switch {
|
||||||
case beers < 6:
|
case beers < 6:
|
||||||
status = "Critical"
|
status = "Critical"
|
||||||
break
|
|
||||||
case beers < 12:
|
case beers < 12:
|
||||||
status = "Warning"
|
status = "Warning"
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|
||||||
beer := dashboardMetric{
|
beer := dashboardMetric{
|
||||||
|
@ -43,6 +41,7 @@ func runWelcomePage(cfg *config.Config) {
|
||||||
body, err := json.Marshal(beer)
|
body, err := json.Marshal(beer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
url := fmt.Sprintf("%s/welcome/beer_available", baseURL)
|
url := fmt.Sprintf("%s/welcome/beer_available", baseURL)
|
||||||
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(body))
|
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(body))
|
||||||
|
@ -50,6 +49,7 @@ func runWelcomePage(cfg *config.Config) {
|
||||||
resp, err := http.DefaultClient.Do(req)
|
resp, err := http.DefaultClient.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[WelcomeRunner] %s", err)
|
log.Printf("[WelcomeRunner] %s", err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue