Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/daemon/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ type HealthChecker struct {
// IsResponding checks if the server is responding
func (h *HealthChecker) IsResponding() bool {
httpClient := &http.Client{Timeout: 2 * time.Second}
versionURL := strings.TrimRight(h.BaseURL, "/") + "/version"
pingURL := strings.TrimRight(h.BaseURL, "/") + "/ping"

const maxRetries = 3
for i := range maxRetries {
resp, err := httpClient.Get(versionURL)
resp, err := httpClient.Get(pingURL)
if err == nil {
defer resp.Body.Close()
if resp.StatusCode == http.StatusOK {
Expand All @@ -42,7 +42,7 @@ func (h *HealthChecker) WaitForReady(timeout time.Duration) error {
resp, err := httpClient.Get(pingURL)
if err == nil {
resp.Body.Close()
if resp.StatusCode >= 200 && resp.StatusCode < 300 {
if resp.StatusCode == http.StatusOK {
return nil
}
}
Expand Down
Loading