1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! # State configuration.
//!
//! [`StateConfig`] controls TTLs and sweep interval for [`TaskState`](super::TaskState).
use Duration;
/// Configuration for in-memory state retention and periodic sweep.
///
/// | Parameter | Controls | Default |
/// |------------------|-------------------------------------------------------------|-------------|
/// | `run_ttl` | How long finished runs are retained before sweep removes them | 1 hour |
/// | `task_ttl` | How long terminal tasks (no active runs) are retained | 1 hour |
/// | `sweep_interval` | How often the sweep runs | 5 minutes |
///
/// ## Also
///
/// - `TaskState::sweep` consumes these TTL settings.
/// - [`SupervisorApi::new`](crate::SupervisorApi::new) accepts this config and auto-starts the sweep task.