accept a ref to a HttpClient
... since the functions don't actually need to own the value. Signed-off-by: Hannes Laimer <h.laimer@proxmox.com> Reviewed-by: Lukas Wagner <l.wagner@proxmox.com> Tested-by: Lukas Wagner <l.wagner@proxmox.com> Tested-by: Tested-by: Gabriel Goller <g.goller@proxmox.com>
This commit is contained in:
parent
8f49d60330
commit
09683f1290
@ -34,7 +34,7 @@ async fn run() -> Result<(), Error> {
|
||||
let backup_time = proxmox_time::parse_rfc3339("2019-06-28T10:49:48Z")?;
|
||||
|
||||
let client = BackupReader::start(
|
||||
client,
|
||||
&client,
|
||||
None,
|
||||
"store2",
|
||||
&BackupNamespace::root(),
|
||||
|
@ -44,7 +44,7 @@ impl BackupReader {
|
||||
|
||||
/// Create a new instance by upgrading the connection at '/api2/json/reader'
|
||||
pub async fn start(
|
||||
client: HttpClient,
|
||||
client: &HttpClient,
|
||||
crypt_config: Option<Arc<CryptConfig>>,
|
||||
datastore: &str,
|
||||
ns: &BackupNamespace,
|
||||
|
@ -75,7 +75,7 @@ async fn dump_catalog(param: Value) -> Result<Value, Error> {
|
||||
let client = connect(&repo)?;
|
||||
|
||||
let client = BackupReader::start(
|
||||
client,
|
||||
&client,
|
||||
crypt_config.clone(),
|
||||
repo.store(),
|
||||
&backup_ns,
|
||||
@ -187,7 +187,7 @@ async fn catalog_shell(param: Value) -> Result<(), Error> {
|
||||
};
|
||||
|
||||
let client = BackupReader::start(
|
||||
client,
|
||||
&client,
|
||||
crypt_config.clone(),
|
||||
repo.store(),
|
||||
&backup_ns,
|
||||
|
@ -1313,7 +1313,7 @@ async fn restore(
|
||||
};
|
||||
|
||||
let client = BackupReader::start(
|
||||
client,
|
||||
&client,
|
||||
crypt_config.clone(),
|
||||
repo.store(),
|
||||
&ns,
|
||||
|
@ -234,7 +234,7 @@ async fn mount_do(param: Value, pipe: Option<OwnedFd>) -> Result<Value, Error> {
|
||||
};
|
||||
|
||||
let client = BackupReader::start(
|
||||
client,
|
||||
&client,
|
||||
crypt_config.clone(),
|
||||
repo.store(),
|
||||
&backup_ns,
|
||||
|
@ -107,7 +107,7 @@ async fn list_files(
|
||||
) -> Result<Vec<ArchiveEntry>, Error> {
|
||||
let client = connect(&repo)?;
|
||||
let client = BackupReader::start(
|
||||
client,
|
||||
&client,
|
||||
crypt_config.clone(),
|
||||
repo.store(),
|
||||
&namespace,
|
||||
@ -430,7 +430,7 @@ async fn extract(
|
||||
|
||||
let client = connect(&repo)?;
|
||||
let client = BackupReader::start(
|
||||
client,
|
||||
&client,
|
||||
crypt_config.clone(),
|
||||
repo.store(),
|
||||
&namespace,
|
||||
|
@ -294,7 +294,7 @@ async fn create_backup_reader(
|
||||
};
|
||||
let client = connect(¶ms.repo)?;
|
||||
let backup_reader = BackupReader::start(
|
||||
client,
|
||||
&client,
|
||||
params.crypt_config.clone(),
|
||||
params.repo.store(),
|
||||
¶ms.namespace,
|
||||
|
@ -738,7 +738,7 @@ async fn pull_group(
|
||||
)?;
|
||||
|
||||
let reader = BackupReader::start(
|
||||
new_client,
|
||||
&new_client,
|
||||
None,
|
||||
params.source.store(),
|
||||
&remote_ns,
|
||||
|
Loading…
x
Reference in New Issue
Block a user