diff --git a/runtime/health/server.go b/runtime/health/server.go index d21601c..dcd1c19 100644 --- a/runtime/health/server.go +++ b/runtime/health/server.go @@ -57,11 +57,11 @@ func (h ReadinessHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if probe.Check == nil { result.State, result.Reason, result.Detail = "DEGRADED", "PROBE_NOT_CONFIGURED", "probe is not configured" } else { - probeTimeout := timeout - if probe.Timeout > 0 { - probeTimeout = probe.Timeout - } - ctx, cancel := context.WithTimeout(r.Context(), probeTimeout) + probeTimeout := timeout + if probe.Timeout > 0 { + probeTimeout = probe.Timeout + } + ctx, cancel := context.WithTimeout(r.Context(), probeTimeout) err := probe.Check(ctx) cancel() if err != nil {