mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-06 13:03:24 +00:00
client: backup: early check for fixed index type
Early return when the check fails, avoiding constuction of unused object instances. Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
fcea0794c8
commit
ceea2e485f
@ -192,6 +192,10 @@ async fn backup_directory<P: AsRef<Path>>(
|
||||
pxar_create_options: pbs_client::pxar::PxarCreateOptions,
|
||||
upload_options: UploadOptions,
|
||||
) -> Result<BackupStats, Error> {
|
||||
if upload_options.fixed_size.is_some() {
|
||||
bail!("cannot backup directory with fixed chunk size!");
|
||||
}
|
||||
|
||||
let pxar_stream = PxarBackupStream::open(dir_path.as_ref(), catalog, pxar_create_options)?;
|
||||
let mut chunk_stream = ChunkStream::new(pxar_stream, chunk_size);
|
||||
|
||||
@ -206,9 +210,6 @@ async fn backup_directory<P: AsRef<Path>>(
|
||||
}
|
||||
});
|
||||
|
||||
if upload_options.fixed_size.is_some() {
|
||||
bail!("cannot backup directory with fixed chunk size!");
|
||||
}
|
||||
|
||||
let stats = client
|
||||
.upload_stream(archive_name, stream, upload_options)
|
||||
|
Loading…
Reference in New Issue
Block a user