From 4856de9a8e330086eb9e96c8e829f8cabbc144ca Mon Sep 17 00:00:00 2001 From: Valentin Knabel Date: Fri, 26 Jul 2024 15:18:05 +0200 Subject: [PATCH] fix(lint): explicitly ignored ctx --- healthstatus/async-check.go | 6 +----- healthstatus/deferred-error-check.go | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/healthstatus/async-check.go b/healthstatus/async-check.go index 14e8931..56e35f3 100644 --- a/healthstatus/async-check.go +++ b/healthstatus/async-check.go @@ -40,7 +40,7 @@ func (c *AsyncHealthCheck) ServiceName() string { func (c *AsyncHealthCheck) Check(context.Context) (HealthResult, error) { c.log.Debug("checked async") if c.ticker == nil { - c.Start(context.Background()) + c.Start(context.Background()) //nolint:contextcheck } return c.current.Status, c.current.Err } @@ -97,10 +97,6 @@ func (r *AsyncHealthCheck) ForceUpdateStatus(ctx context.Context) error { func (r *AsyncHealthCheck) updateStatus(ctx context.Context) error { r.log.Info("evaluating current service health statuses") - if ctx == nil { - ctx = context.Background() - } - ctx, cancel := context.WithTimeout(ctx, r.healthCheckInterval/2) defer cancel() diff --git a/healthstatus/deferred-error-check.go b/healthstatus/deferred-error-check.go index 798a51f..f2ce24a 100644 --- a/healthstatus/deferred-error-check.go +++ b/healthstatus/deferred-error-check.go @@ -35,7 +35,7 @@ func (c *DeferredErrorHealthCheck) Check(ctx context.Context) (HealthResult, err if err == nil { c.errorCountSinceSuccess = 0 c.lastSuccess = state - return status, err + return status, nil } c.errorCountSinceSuccess++ if c.errorCountSinceSuccess > c.maxIgnoredErrors {