homestar_runtime/workflow/
settings.rs1use std::time::Duration;
6
7#[derive(Debug, Clone, PartialEq)]
9pub struct Settings {
10 pub(crate) retries: u32,
12 pub(crate) retry_max_delay: Duration,
14 pub(crate) retry_initial_delay: Duration,
16 pub(crate) timeout: Duration,
18}
19
20#[cfg(all(not(test), not(feature = "test-utils")))]
21impl Default for Settings {
22 fn default() -> Self {
23 Self {
24 retries: 3,
25 retry_max_delay: Duration::new(60, 0),
26 retry_initial_delay: Duration::from_millis(500),
27 timeout: Duration::new(3600, 0),
28 }
29 }
30}
31
32#[cfg(any(test, feature = "test-utils"))]
33#[cfg_attr(docsrs, doc(cfg(feature = "test-utils")))]
34impl Default for Settings {
35 fn default() -> Self {
36 Self {
37 retries: 0,
38 retry_max_delay: Duration::new(1, 0),
39 retry_initial_delay: Duration::from_millis(50),
40 timeout: Duration::from_secs(3600),
41 }
42 }
43}