Closed nwaizer closed 2 years ago
may I use github.com/avast/retry-go ?
The retry needs are pretty basic, so it really would be best to just put in a retry loop and not bring in a whole library just to do it. Something along the lines of:
for i := 0; i < retryAttempts; i++ {
resp, err = eventservice.Client.Post(eventservice.SubmitTestEventTarget, p)
if err == nil {
break
}
log.Printf("Failed to send test event (%d/%d)\n", i+1, retryAttempts)
time.Sleep(retryInterval)
}
if err != nil {
return err
}
Done
Thanks, but pulling in all of apimachinery is pretty heavy wait for this. Is there another library that can give the functionality you need without doing that? Gofish dependencies should be kept very minimal.