integration test snapshot

This commit is contained in:
mpostma 2021-03-24 11:03:01 +01:00
parent 06f9dae0f3
commit 1f16c8d224
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
5 changed files with 55 additions and 134 deletions

View file

@ -39,6 +39,7 @@ where
}
pub async fn run(self) {
info!("Snashot scheduled every {}s.", self.snapshot_period.as_secs());
loop {
sleep(self.snapshot_period).await;
if let Err(e) = self.perform_snapshot().await {
@ -52,6 +53,8 @@ where
bail!("Invalid snapshot file path.");
}
info!("Performing snapshot.");
let temp_snapshot_dir = spawn_blocking(move || tempfile::tempdir_in(".")).await??;
let temp_snapshot_path = temp_snapshot_dir.path().to_owned();