This PR removes the Sleep func in the retry state and instead uses the following contruct to either wait the determined amount of time, or cancel if the context is canceled. I also added a test case that reproduces this scenario.
select {
case <-ctx.Done():
s.Errs = []error{context.Canceled}
return false
case <-time.After(sleepTime):
}
This PR removes the
Sleep
func in the retry state and instead uses the following contruct to either wait the determined amount of time, or cancel if the context is canceled. I also added a test case that reproduces this scenario.