From 8e6e18b77c9729ac3b86c02bbd3122bd26948ccf Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 12 Jun 2020 11:40:18 +0200 Subject: [PATCH] client: make dump_image async, use async chunk reader Signed-off-by: Wolfgang Bumiller --- src/bin/proxmox-backup-client.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index 2634a8f5..b05c60b5 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -39,6 +39,7 @@ use proxmox_backup::backup::{ store_key_config, verify_chunk_size, ArchiveType, + AsyncReadChunk, BackupDir, BackupGroup, BackupManifest, @@ -55,7 +56,6 @@ use proxmox_backup::backup::{ IndexFile, KeyConfig, MANIFEST_BLOB_NAME, - ReadChunk, Shell, }; @@ -1099,7 +1099,7 @@ fn complete_backup_source(arg: &str, param: &HashMap) -> Vec( +async fn dump_image( client: Arc, crypt_config: Option>, index: FixedIndexReader, @@ -1119,7 +1119,7 @@ fn dump_image( for pos in 0..index.index_count() { let digest = index.index_digest(pos).unwrap(); - let raw_data = chunk_reader.read_chunk(&digest)?; + let raw_data = chunk_reader.read_chunk(&digest).await?; writer.write_all(&raw_data)?; bytes += raw_data.len(); if verbose { @@ -1323,7 +1323,7 @@ async fn restore(param: Value) -> Result { .map_err(|err| format_err!("unable to open /dev/stdout - {}", err))? }; - dump_image(client.clone(), crypt_config.clone(), index, &mut writer, verbose)?; + dump_image(client.clone(), crypt_config.clone(), index, &mut writer, verbose).await?; } Ok(Value::Null)