diff --git a/healthcheck/healthcheck.go b/healthcheck/healthcheck.go index 72a14bcc7..a8b0de4fc 100644 --- a/healthcheck/healthcheck.go +++ b/healthcheck/healthcheck.go @@ -86,7 +86,11 @@ func (hc *HealthCheck) execute() { } func testHealth(serverURL *url.URL, checkURL string) bool { - resp, err := http.Get(serverURL.String() + checkURL) + timeout := time.Duration(5 * time.Second) + client := http.Client{ + Timeout: timeout, + } + resp, err := client.Get(serverURL.String() + checkURL) if err != nil || resp.StatusCode != 200 { return false }