INNER CODE UNIT · Go
checkHealth
orneryd/NornicDB · cmd/eval/main.go:521
func checkHealth(serverURL string) error {
healthURL, err := url.JoinPath(serverURL, "health")
if err != nil {
return fmt.Errorf("failed to construct health URL: %w", err)
}
client := newSafeClient(5 * time.Second)
resp, err := client.Get(healthURL)
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("unhealthy: status %d", resp.StatusCode)
}
return nil
}
func parseThresholds(s string) eval.Thresholds {