retry
API
retry
packageAPI reference for the retry
package.
F
function
Do
Do runs fn with a compact retry API backed by go-foundation resiliency helpers.
Parameters
Returns
error
pkg/retry/retry.go:10-16
func Do(ctx context.Context, fn func() error, attempts int) error
{
if attempts <= 0 {
attempts = 3
}
return resiliency.Retry(ctx, fn, resiliency.WithAttempts(attempts))
}