pinakes-server: warn on backup cleanup failure; add error logging around
`clear_database` Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I903ce59772c16883642c82427be8167a6a6a6964
This commit is contained in:
parent
61eb2335d3
commit
1f7d7ea925
2 changed files with 5 additions and 1 deletions
|
|
@ -31,7 +31,9 @@ pub async fn create_backup(
|
|||
let bytes = tokio::fs::read(&backup_path)
|
||||
.await
|
||||
.map_err(|e| ApiError(pinakes_core::error::PinakesError::Io(e)))?;
|
||||
let _ = tokio::fs::remove_dir_all(&backup_dir).await;
|
||||
if let Err(e) = tokio::fs::remove_dir_all(&backup_dir).await {
|
||||
tracing::warn!(path = %backup_dir.display(), error = %e, "failed to clean up backup temp dir");
|
||||
}
|
||||
|
||||
let disposition = format!("attachment; filename=\"{filename}\"");
|
||||
Ok(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue