Documentation ¶
Index ¶
Constants ¶
View Source
const ( MaxLastErrors = 100 SameErrorThreshold = 80 LastErrorRecycleTimeMultiplier = 100 ShortWait = 3 * time.Second LongWait = 1 * time.Minute LongWaitAlertThreshold = 5 * time.Minute )
View Source
const ( RetryActionShortWait = iota RetryActionLongWait RetryActionAbort )
Variables ¶
This section is empty.
Functions ¶
func SetTestMode ¶
func SetTestMode(enabled bool)
func UpdateRetryAfter ¶
func WaitIfRequired ¶
func WaitIfRequired(hash, endpoint string)
Types ¶
type LimitState ¶
type LimitState interface { // Add error that happened with request. Blocks operation for retry SLA. // When abort == true, recommend abort retry loop if certain threshold exceed by given err. AddError(hash, endpoint string, err error) (abort bool) // Update retry after, if Rewind-After header present in the response UpdateRetryAfter(hash, endpoint string, retryAfter time.Time) // Wait if required. Waits for Max(Rewind-After, RetryActionWait). WaitIfRequired(hash, endpoint string) }
Click to show internal directories.
Click to hide internal directories.