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