Use asynchronous file removal in backup process
This commit is contained in:
parent
8152d3d9b0
commit
104ae6b38e
1 changed files with 1 additions and 1 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue