[pdm-devel] [PATCH proxmox-datacenter-manager 2/2] server: parallel fetcher: refactor: use helpers for common operations

Stefan Hanreich s.hanreich at proxmox.com
Fri Aug 29 14:33:29 CEST 2025


The introduction of the helper that executes the callback once per
remote factored out some common functionality from existing helpers.
Adapt the existing helper that queries all nodes to also use those
helpers to avoid duplicated code.

No functional changes intended.

Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 server/src/parallel_fetcher.rs | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/server/src/parallel_fetcher.rs b/server/src/parallel_fetcher.rs
index e55cc25..5f6a317 100644
--- a/server/src/parallel_fetcher.rs
+++ b/server/src/parallel_fetcher.rs
@@ -223,16 +223,7 @@ impl<C: Clone + Send + 'static> ParallelFetcher<C> {
 
         match remote.ty {
             RemoteType::Pve => {
-                let remote_clone = remote.clone();
-
-                let nodes = match async move {
-                    let client = connection::make_pve_client(&remote_clone)?;
-                    let nodes = client.list_nodes().await?;
-
-                    Ok::<Vec<ClusterNodeIndexResponse>, Error>(nodes)
-                }
-                .await
-                {
+                let nodes = match Self::fetch_pve_node_list(&remote).await {
                     Ok(nodes) => nodes,
                     Err(err) => return (remote.id.clone(), Err(err)),
                 };
-- 
2.47.2




More information about the pdm-devel mailing list