Skip to content

Commit

Permalink
fix: handle an error of timer.Wait
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jan 11, 2025
1 parent fa79338 commit a66f099
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controller/vacuum/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ func (vc *Controller) withDBRetry(ctx context.Context, logE *logrus.Entry, fn fu

logerr.WithError(logE, err).WithField("attempt", i+1).Warn("retrying database operation")

timer.Wait(ctx, backoff)
if err := timer.Wait(ctx, backoff); err != nil {
return fmt.Errorf("wait for retrying database operation: %w", err)
}
backoff *= exponentialBackoff
}

Expand Down

0 comments on commit a66f099

Please sign in to comment.