pub struct MaintenanceConfig { /* private fields */ }Expand description
Leader-owned maintenance timing and retention settings.
Like River’s other configuration values, MaintenanceConfig has a getter
for each setting and a with_* method that returns the configuration
with that setting changed.
Implementations§
Source§impl MaintenanceConfig
impl MaintenanceConfig
Sourcepub const fn cancelled_job_retention(&self) -> Retention
pub const fn cancelled_job_retention(&self) -> Retention
Returns how long cancelled jobs are kept before the job cleaner deletes them.
Sourcepub const fn with_cancelled_job_retention(self, retention: Retention) -> Self
pub const fn with_cancelled_job_retention(self, retention: Retention) -> Self
Sets how long cancelled jobs are kept before the job cleaner deletes them. Defaults to deleting them after 24 hours.
Sourcepub const fn completed_job_retention(&self) -> Retention
pub const fn completed_job_retention(&self) -> Retention
Returns how long completed jobs are kept before the job cleaner deletes them.
Sourcepub const fn with_completed_job_retention(self, retention: Retention) -> Self
pub const fn with_completed_job_retention(self, retention: Retention) -> Self
Sets how long completed jobs are kept before the job cleaner deletes them. Defaults to deleting them after 24 hours.
Sourcepub const fn discarded_job_retention(&self) -> Retention
pub const fn discarded_job_retention(&self) -> Retention
Returns how long discarded jobs are kept before the job cleaner deletes them.
Sourcepub const fn with_discarded_job_retention(self, retention: Retention) -> Self
pub const fn with_discarded_job_retention(self, retention: Retention) -> Self
Sets how long discarded jobs are kept before the job cleaner deletes them. Defaults to deleting them after 7 days.
Sourcepub const fn elect_interval(&self) -> Duration
pub const fn elect_interval(&self) -> Duration
Returns how often the client bids for leadership, or renews it while leader.
Sourcepub const fn with_elect_interval(self, value: Duration) -> Self
pub const fn with_elect_interval(self, value: Duration) -> Self
Sets how often the client bids for leadership, or renews it while leader. Defaults to 5 seconds.
Sourcepub const fn job_cleaner_interval(&self) -> Duration
pub const fn job_cleaner_interval(&self) -> Duration
Returns how often the leader deletes finalized jobs past their retention.
Sourcepub const fn with_job_cleaner_interval(self, value: Duration) -> Self
pub const fn with_job_cleaner_interval(self, value: Duration) -> Self
Sets how often the leader deletes finalized jobs past their retention. Defaults to 30 seconds.
Sourcepub const fn job_cleaner_timeout(&self) -> Duration
pub const fn job_cleaner_timeout(&self) -> Duration
Returns the timeout for each batch the job cleaner deletes.
Sourcepub const fn with_job_cleaner_timeout(self, value: Duration) -> Self
pub const fn with_job_cleaner_timeout(self, value: Duration) -> Self
Sets the timeout for each batch the job cleaner deletes. Defaults to 30 seconds.
Sourcepub const fn rescue_after(&self) -> Option<Duration>
pub const fn rescue_after(&self) -> Option<Duration>
Returns the explicitly configured rescue age, if any.
When unset, a client rescues jobs running longer than one hour, or than its job timeout plus one hour when a job timeout is configured.
Sourcepub const fn with_rescue_after(self, value: Duration) -> Self
pub const fn with_rescue_after(self, value: Duration) -> Self
Sets the age at which running jobs are considered stuck and rescued. It must not be shorter than the client’s job timeout.
Sourcepub const fn rescuer_interval(&self) -> Duration
pub const fn rescuer_interval(&self) -> Duration
Returns how often the leader looks for stuck jobs to rescue.
Sourcepub const fn with_rescuer_interval(self, value: Duration) -> Self
pub const fn with_rescuer_interval(self, value: Duration) -> Self
Sets how often the leader looks for stuck jobs to rescue. Defaults to 30 seconds.
Sourcepub const fn queue_retention(&self) -> Duration
pub const fn queue_retention(&self) -> Duration
Returns how long a queue record no client has touched is kept before the queue cleaner deletes it.
Sourcepub const fn with_queue_retention(self, value: Duration) -> Self
pub const fn with_queue_retention(self, value: Duration) -> Self
Sets how long a queue record no client has touched is kept before the queue cleaner deletes it. Defaults to 24 hours.
Sourcepub const fn queue_cleaner_interval(&self) -> Duration
pub const fn queue_cleaner_interval(&self) -> Duration
Returns how often the leader deletes queue records past their retention.
Sourcepub const fn with_queue_cleaner_interval(self, value: Duration) -> Self
pub const fn with_queue_cleaner_interval(self, value: Duration) -> Self
Sets how often the leader deletes queue records past their retention. Defaults to 1 hour.
Sourcepub const fn scheduler_interval(&self) -> Duration
pub const fn scheduler_interval(&self) -> Duration
Returns how often the leader makes due scheduled and retryable jobs available.
Sourcepub const fn with_scheduler_interval(self, value: Duration) -> Self
pub const fn with_scheduler_interval(self, value: Duration) -> Self
Sets how often the leader makes due scheduled and retryable jobs available. Defaults to 5 seconds.
Trait Implementations§
Source§impl Clone for MaintenanceConfig
impl Clone for MaintenanceConfig
Source§impl Debug for MaintenanceConfig
impl Debug for MaintenanceConfig
Auto Trait Implementations§
impl Freeze for MaintenanceConfig
impl RefUnwindSafe for MaintenanceConfig
impl Send for MaintenanceConfig
impl Sync for MaintenanceConfig
impl Unpin for MaintenanceConfig
impl UnsafeUnpin for MaintenanceConfig
impl UnwindSafe for MaintenanceConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more