RetryConfig

data class RetryConfig(val maxRetries: Int? = null, val exponentialDelay: Boolean = false, val retryOnServerErrors: Boolean = false)(source)

如果配置了 retry,则在转化为 BotConfiguration 的时候, 会通过 BotConfiguration.apiClientAdditionalConfiguration 注册并配置 io.ktor.client.plugins.HttpRequestRetry 插件。

如果需要更精细化的配置,则需要通过代码进行配置。

Since

4.5.0

Constructors

Link copied to clipboard
constructor(maxRetries: Int? = null, exponentialDelay: Boolean = false, retryOnServerErrors: Boolean = false)

Properties

Link copied to clipboard

是否启用指数延迟。如果启用,会使用 io.ktor.client.plugins.HttpRequestRetry.Configuration.exponentialDelay 的默认值配置指数延迟。

Link copied to clipboard
val maxRetries: Int? = null

最大重试次数。如果为 null,则不启用重试。

Link copied to clipboard

是否启用服务器错误重试。如果启用,会使用 io.ktor.client.plugins.HttpRequestRetry.Configuration.retryOnServerErrors 的默认值配置服务器错误重试。