Skip to content

When performing retries with a Client, allow the user to take some action in between each retry. #2305

Answered by AlexVulaj
AlexVulaj asked this question in Q&A
Discussion options

You must be logged in to vote

For anyone else curious, I ended up overriding the Backoff function with something like this:

...
config.WithRetryer(func() aws.Retryer {
	return retry.NewStandard(func(opts *retry.StandardOptions) {
		opts.Backoff = retry.BackoffDelayerFunc(func(attempt int, err error) (time.Duration, error) {
			fmt.Printf("Retry attempt %v of %v\n", attempt, opts.MaxAttempts)
			return 3 * time.Second, nil
		})
	})
})
...

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by AlexVulaj
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant