From 104ae6b38e97f01275a159758ddcdfe5574d11b5 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Wed, 30 Apr 2025 01:51:09 +0200 Subject: [PATCH] Use asynchronous file removal in backup process --- backend/src/data/backup.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/data/backup.rs b/backend/src/data/backup.rs index 3cb376a..1d61237 100644 --- a/backend/src/data/backup.rs +++ b/backend/src/data/backup.rs @@ -64,7 +64,7 @@ async fn start(db_connection: &db::Connection, path: &PathBuf) { Ok(mut file_output) => { if let Err(error) = tokio::io::copy(&mut encoder, &mut file_output).await { error!("Error when compressing backup file: {}", error); - } else if let Err(error) = std::fs::remove_file(path) { + } else if let Err(error) = tokio::fs::remove_file(path).await { error!("Error when removing uncompressed backup file: {}", error); } else { info!("Backup done: {}", path_compressed.display());