in 'restore_archive', we reach that 'catalog.commit()' for
* every skipped snapshot (we already call 'commit_if_large' then before)
* every skipped chunk archive (no change in catalog since we do not read
the chunk archive in that case)
* after reading a catalog (no change in catalog)
in all other cases, we call 'commit_if_large' and return early,
meaning that the 'commit' there was executed too often and
unnecessary, so move it after the loop over the files, before
finishing the temporary database.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
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(())
_ => bail!("unknown content magic {:?}", header.content_magic),
}
- catalog.commit()?;
-
Ok(())
}