Skip to content

Commit

Permalink
recommiting code
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblakeley committed Sep 27, 2017
1 parent 16d8647 commit b50e27f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dashboard_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ func (h *HTTPDashboardHandler) Register() error {
c := &http.Client{Timeout: 5 * time.Second}
resp, err := c.Do(req)

if err != nil || resp.StatusCode != 200 {
log.Errorf("Request failed with code %d and error %v; retrying in 5s", resp.StatusCode, err)
if err != nil {
log.Errorf("Request failed with error %v; retrying in 5s", err)
time.Sleep(time.Second * 5)
return h.Register()
} else if resp != nil && resp.StatusCode != 200 {
log.Errorf("Response failed with code %d; retrying in 5s", resp.StatusCode)
time.Sleep(time.Second * 5)
return h.Register()
}
Expand Down

0 comments on commit b50e27f

Please sign in to comment.