Documentation ¶
Index ¶
- Constants
- func ApplyMinMaxDefaults(sleepDuration time.Duration) time.Duration
- func GenerateSleepDuration(backoffMultiplier int, timelineProvider timeutils.TimelineProvider) (sleepDuration time.Duration, humanReadableResetTimestamp string)
- func ThrottleCallAfterError(backoffMultiplier int, message string, a ...any)
Constants ¶
View Source
const MinWaitDuration = 1 * time.Second
Variables ¶
This section is empty.
Functions ¶
func GenerateSleepDuration ¶
func GenerateSleepDuration(backoffMultiplier int, timelineProvider timeutils.TimelineProvider) (sleepDuration time.Duration, humanReadableResetTimestamp string)
GenerateSleepDuration will generate a random sleep duration time between minWaitTime and minWaitTime * backoffMultiplier generated sleep durations are used in case the API did not reply with a limit and reset time and called with the current retry iteration count to implement increasing possible wait times per iteration
func ThrottleCallAfterError ¶
ThrottleCallAfterError sleeps a bit after an error message to avoid hitting rate limits and getting the IP banned
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.