Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoWithRetry ¶
func DoWithRetry(actionDescription string, maxRetries int, sleepBetweenRetries time.Duration, logger *logrus.Entry, action func(attempt int) error) error
DoWithRetry runs the specified action. If it returns a value, return that value. If it returns an error, sleep for sleepBetweenRetries and try again, up to a maximum of maxRetries retries. If maxRetries is exceeded, return a MaxRetriesExceeded error.
Types ¶
type MaxRetriesExceeded ¶
MaxRetriesExceeded is an error that occurs when the maximum amount of retries is exceeded.
func (MaxRetriesExceeded) Error ¶
func (err MaxRetriesExceeded) Error() string
Click to show internal directories.
Click to hide internal directories.