pub struct TaskConfig {
pub timeout: Option<Duration>,
pub max_retries: u32,
pub retry_delay: Duration,
pub fail_scheduler_on_error: bool,
}Expand description
Configuration options for task execution behavior.
TaskConfig allows fine-grained control over how tasks are executed,
including timeout settings, retry behavior, and error handling.
§Examples
use cronline::TaskConfig;
use std::time::Duration;
let config = TaskConfig {
timeout: Some(Duration::from_secs(30)),
max_retries: 5,
retry_delay: Duration::from_secs(10),
fail_scheduler_on_error: false,
};Fields§
§timeout: Option<Duration>Maximum execution time before the task is timed out.
If Some, the task will be cancelled if it exceeds this duration.
If None, the task can run indefinitely.
max_retries: u32Maximum number of retries on failure.
If a task fails, it will be retried up to this many times before giving up. Set to 0 for no retries.
retry_delay: DurationDelay between retry attempts.
After a task fails, this duration will elapse before the next retry.
fail_scheduler_on_error: boolWhether a permanent task failure should stop the scheduler.
If true, the scheduler will stop if this task fails after all retries.
If false, the scheduler continues running other tasks.
Trait Implementations§
Source§impl Clone for TaskConfig
impl Clone for TaskConfig
Source§fn clone(&self) -> TaskConfig
fn clone(&self) -> TaskConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more