logtail/backoff: update Backoff.BackOff docs (#12229)

Update #cleanup

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited 2024-05-23 09:53:05 -07:00 committed by GitHub
parent 538c2e8f7c
commit 4214e5f71b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,9 +44,8 @@ func NewBackoff(name string, logf logger.Logf, maxBackoff time.Duration) *Backof
}
}
// Backoff sleeps an increasing amount of time if err is non-nil.
// and the context is not a
// It resets the backoff schedule once err is nil.
// BackOff sleeps an increasing amount of time if err is non-nil while the
// context is active. It resets the backoff schedule once err is nil.
func (b *Backoff) BackOff(ctx context.Context, err error) {
if err == nil {
// No error. Reset number of consecutive failures.