From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E29E29293F for ; Mon, 8 Apr 2024 11:05:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BD4D66D38 for ; Mon, 8 Apr 2024 11:05:00 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 8 Apr 2024 11:04:58 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id A91CE444C8 for ; Mon, 8 Apr 2024 11:04:58 +0200 (CEST) Date: Mon, 08 Apr 2024 11:04:54 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Backup Server development discussion References: <20240328123707.336951-1-c.ebner@proxmox.com> <20240328123707.336951-17-c.ebner@proxmox.com> In-Reply-To: <20240328123707.336951-17-c.ebner@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1712566705.if9kdm81q4.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.058 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [main.rs, benchmark.rs, upload-speed.rs, proxmox.com] Subject: [pbs-devel] applied: [PATCH v3 proxmox-backup 16/58] client: backup writer: only borrow http client X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2024 09:05:30 -0000 this one is independent from the rest, applied already, thanks :) in general it's helpful to order such patches first - increases the chances of them being applied, since then it's obvious that they don't include side-effects from earlier patches ;) On March 28, 2024 1:36 pm, Christian Ebner wrote: > Instead of taking ownership of the http client when starting a new > BackupWriter instance, only borrow the client. >=20 > This allows to reuse the http client to later reuse it to start also a > BackupReader instance as required for backup runs with metadata based > file change detection mode, where both must use the same http client. >=20 > Signed-off-by: Christian Ebner > --- > changes since version 2: > - not present in previous version >=20 > examples/upload-speed.rs | 2 +- > pbs-client/src/backup_writer.rs | 2 +- > proxmox-backup-client/src/benchmark.rs | 2 +- > proxmox-backup-client/src/main.rs | 4 ++-- > 4 files changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/examples/upload-speed.rs b/examples/upload-speed.rs > index f9fc52a85..e4b570ec5 100644 > --- a/examples/upload-speed.rs > +++ b/examples/upload-speed.rs > @@ -18,7 +18,7 @@ async fn upload_speed() -> Result { > let backup_time =3D proxmox_time::epoch_i64(); > =20 > let client =3D BackupWriter::start( > - client, > + &client, > None, > datastore, > &BackupNamespace::root(), > diff --git a/pbs-client/src/backup_writer.rs b/pbs-client/src/backup_writ= er.rs > index 8a03d8ea6..8bd0e4f36 100644 > --- a/pbs-client/src/backup_writer.rs > +++ b/pbs-client/src/backup_writer.rs > @@ -78,7 +78,7 @@ impl BackupWriter { > // FIXME: extract into (flattened) parameter struct? > #[allow(clippy::too_many_arguments)] > pub async fn start( > - client: HttpClient, > + client: &HttpClient, > crypt_config: Option>, > datastore: &str, > ns: &BackupNamespace, > diff --git a/proxmox-backup-client/src/benchmark.rs b/proxmox-backup-clie= nt/src/benchmark.rs > index b3047308c..1262fb46d 100644 > --- a/proxmox-backup-client/src/benchmark.rs > +++ b/proxmox-backup-client/src/benchmark.rs > @@ -229,7 +229,7 @@ async fn test_upload_speed( > =20 > log::debug!("Connecting to backup server"); > let client =3D BackupWriter::start( > - client, > + &client, > crypt_config.clone(), > repo.store(), > &BackupNamespace::root(), > diff --git a/proxmox-backup-client/src/main.rs b/proxmox-backup-client/sr= c/main.rs > index 546275cb1..148708976 100644 > --- a/proxmox-backup-client/src/main.rs > +++ b/proxmox-backup-client/src/main.rs > @@ -834,7 +834,7 @@ async fn create_backup( > =20 > let backup_time =3D backup_time_opt.unwrap_or_else(epoch_i64); > =20 > - let client =3D connect_rate_limited(&repo, rate_limit)?; > + let http_client =3D connect_rate_limited(&repo, rate_limit)?; > record_repository(&repo); > =20 > let snapshot =3D BackupDir::from((backup_type, backup_id.to_owned(),= backup_time)); > @@ -886,7 +886,7 @@ async fn create_backup( > }; > =20 > let client =3D BackupWriter::start( > - client, > + &http_client, > crypt_config.clone(), > repo.store(), > &backup_ns, > --=20 > 2.39.2 >=20 >=20 >=20 > _______________________________________________ > pbs-devel mailing list > pbs-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel >=20 >=20 >=20