redup_bootstrap/
oom_config.rs1use redup_config::Config;
4
5use std::time::Duration;
6
7use crate::detection::Detection;
8
9#[derive(Debug, Clone, Copy, PartialEq, Eq, Config)]
12pub struct OomConfig {
13 detection: Detection,
15 modules_shutdown_timeout: Duration,
17}
18
19impl Default for OomConfig {
20 fn default() -> Self {
21 Self {
22 detection: Detection::Manual,
23 modules_shutdown_timeout: Duration::from_secs(15),
24 }
25 }
26}
27
28impl OomConfig {
29 #[cfg(test)]
31 pub(crate) fn detection(&self) -> Detection {
32 self.detection
33 }
34
35 pub fn modules_shutdown_timeout(&self) -> Duration {
37 self.modules_shutdown_timeout
38 }
39}