Retry Policy
data class RetryPolicy(val maxRetries: Int = 2, val initialBackoff: Duration = 500.milliseconds, val maxBackoff: Duration = 5.seconds, val jitter: Double = 0.25, val retryStatuses: Set<Int> = setOf(408, 429) + (500..599), val respectRetryAfter: Boolean = true, val maxRetryAfter: Duration = 60.seconds, val retryOnConnectionError: Boolean = true, val retryOnTimeout: Boolean = true)(source)
When and how failed requests are retried. The defaults match the official Python and JS SDKs: two retries, 0.5 s backoff doubling to a 5 s cap with up to 25% subtracted as jitter, and server retry-after-ms / Retry-After hints honored up to maxRetryAfter.
Constructors
Link copied to clipboard
constructor(maxRetries: Int = 2, initialBackoff: Duration = 500.milliseconds, maxBackoff: Duration = 5.seconds, jitter: Double = 0.25, retryStatuses: Set<Int> = setOf(408, 429) + (500..599), respectRetryAfter: Boolean = true, maxRetryAfter: Duration = 60.seconds, retryOnConnectionError: Boolean = true, retryOnTimeout: Boolean = true)