pub struct RetryConfig {
pub attempts: u32,
pub delay: HumanDuration,
pub max_delay: HumanDuration,
}Expand description
User-facing retry configuration block (retry: at config root).
All fields are optional in YAML; missing fields fall back to GoReleaser’s defaults (10 attempts, 10s base delay, 5m cap).
Fields§
§attempts: u32Total attempts (including the first). Default 10. Values < 1 are
clamped up to 1 by the policy layer.
delay: HumanDurationInitial delay before the second attempt. Default 10s. Subsequent
delays grow exponentially (delay × 2^(n-2)) up to Self::max_delay.
max_delay: HumanDurationUpper bound on any individual sleep between attempts. Default 5m.
Without this cap, an exponential backoff with delay=10s would
stretch attempt 9 to ~42 minutes.
Implementations§
Source§impl RetryConfig
impl RetryConfig
Sourcepub const DEFAULT_ATTEMPTS: u32 = 10
pub const DEFAULT_ATTEMPTS: u32 = 10
Default attempt count (matches GoReleaser pkg/config.Retry.Attempts).
Sourcepub const DEFAULT_DELAY: Duration
pub const DEFAULT_DELAY: Duration
Default initial delay (matches GoReleaser pkg/config.Retry.Delay = 10s).
Sourcepub const DEFAULT_MAX_DELAY: Duration
pub const DEFAULT_MAX_DELAY: Duration
Default delay cap (matches GoReleaser pkg/config.Retry.MaxDelay = 5m).
Sourcepub fn to_policy(&self) -> RetryPolicy
pub fn to_policy(&self) -> RetryPolicy
Bridge to the internal RetryPolicy consumed by
crate::retry::retry_sync / crate::retry::retry_async.
If max_delay < delay, every backoff is immediately capped to
max_delay. This is parity-correct passthrough (GR behaves the same)
but almost certainly a config mistake, so a tracing::warn! fires
once at conversion time to surface the issue in logs.
Trait Implementations§
Source§impl Clone for RetryConfig
impl Clone for RetryConfig
Source§fn clone(&self) -> RetryConfig
fn clone(&self) -> RetryConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetryConfig
impl Debug for RetryConfig
Source§impl Default for RetryConfig
impl Default for RetryConfig
Source§impl<'de> Deserialize<'de> for RetryConfigwhere
RetryConfig: Default,
impl<'de> Deserialize<'de> for RetryConfigwhere
RetryConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for RetryConfig
impl JsonSchema for RetryConfig
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more