fix: delete backup after successfully restoring backup in copy strategy

This commit is contained in:
aster 2025-03-01 13:49:51 +09:00
parent 6b3a36e96e
commit f40a200f99

View file

@ -1092,6 +1092,13 @@ impl Document {
log::error!(
"Failed to restore backup on write failure: {restore_err}"
)
} else {
// successfully restored. delete backup
if let Err(delete_err) = tokio::fs::remove_file(backup).await {
log::error!(
"Failed to remove backup file on write: {delete_err}"
);
}
}
}
BackupKind::Move => {