nexo_driver_loop/
post_compact_cleanup.rs1use std::path::PathBuf;
7use std::sync::Arc;
8
9use crate::extract_memories::ExtractMemories;
10
11pub struct PostCompactCleanup {
14 extract_memories: Option<Arc<ExtractMemories>>,
15 memory_dir: Option<PathBuf>,
16}
17
18impl PostCompactCleanup {
19 pub fn new() -> Self {
20 Self {
21 extract_memories: None,
22 memory_dir: None,
23 }
24 }
25
26 pub fn with_extract_memories(
28 mut self,
29 extract: Arc<ExtractMemories>,
30 memory_dir: PathBuf,
31 ) -> Self {
32 self.extract_memories = Some(extract);
33 self.memory_dir = Some(memory_dir);
34 self
35 }
36
37 pub async fn run(&self) {
39 if let (Some(ref extract), Some(ref memory_dir)) =
40 (&self.extract_memories, &self.memory_dir)
41 {
42 extract.tick();
43 let _ = memory_dir;
47 }
48 }
49}
50
51impl Default for PostCompactCleanup {
52 fn default() -> Self {
53 Self::new()
54 }
55}