persist files in sim memory io for integrity check

This commit is contained in:
pedrocarlo
2025-10-11 14:18:46 -03:00
parent 7725f336b8
commit fafbdbfa9d
4 changed files with 21 additions and 0 deletions

View File

@@ -190,6 +190,17 @@ impl SimIO for MemorySimIO {
file.closed.set(true);
}
}
fn persist_files(&self) -> anyhow::Result<()> {
let files = self.files.borrow();
for (file_path, file) in files.iter() {
if file_path.ends_with(".db") || file_path.ends_with("wal") || file_path.ends_with("lg")
{
std::fs::write(file_path, &*file.buffer.borrow())?;
}
}
Ok(())
}
}
impl Clock for MemorySimIO {