Consul debug
This commit is contained in:
parent
045dd23a76
commit
6dd11c6441
@ -117,19 +117,16 @@ func (s *Service) healthCheck() (bool, error) {
|
||||
healthUrl := s.GetFullAddr() + "health"
|
||||
req, err := http.NewRequest(http.MethodGet, healthUrl, nil)
|
||||
if err != nil {
|
||||
fmt.Printf("CreateRequest error: %v\n", err)
|
||||
return false
|
||||
}
|
||||
req.Header.Set("User-Agent", "service/internal")
|
||||
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
fmt.Printf("SendRequest error: %v\n", err)
|
||||
return false
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
fmt.Printf("ResponseCODE: %v -- %v\n", req, resp)
|
||||
return resp.StatusCode == http.StatusOK
|
||||
}()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user