Skip to content

Commit

Permalink
fix(lint): explicitly ignored ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
vknabel committed Jul 26, 2024
1 parent 14b8a91 commit 4856de9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions healthstatus/async-check.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion healthstatus/deferred-error-check.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4856de9

Please sign in to comment.