diff --git a/src/api2/tape/restore.rs b/src/api2/tape/restore.rs index 1b0bc03f..14b43c07 100644 --- a/src/api2/tape/restore.rs +++ b/src/api2/tape/restore.rs @@ -998,6 +998,8 @@ pub fn restore_media( restore_archive(worker.clone(), reader, current_file_number, target, &mut catalog, checked_chunks_map, verbose)?; } + catalog.commit()?; + MediaCatalog::finish_temporary_database(status_path, &media_id.label.uuid, true)?; Ok(()) @@ -1150,8 +1152,6 @@ fn restore_archive<'a>( _ => bail!("unknown content magic {:?}", header.content_magic), } - catalog.commit()?; - Ok(()) }