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:
raf 2026-03-12 20:48:15 +03:00
commit 1f7d7ea925
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
2 changed files with 5 additions and 1 deletions

View file

@ -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(