From 42bb34951a678d554a8d0a15147e16759441a2cc Mon Sep 17 00:00:00 2001 From: lowit Date: Thu, 22 Dec 2022 18:48:21 +0300 Subject: [PATCH] master: improve errors handling --- src/cloner.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cloner.rs b/src/cloner.rs index 006a232..52b72ed 100644 --- a/src/cloner.rs +++ b/src/cloner.rs @@ -1,4 +1,4 @@ -use futures::future::join_all; +use futures::future::try_join_all; use pbr::ProgressBar; use regex::Regex; @@ -115,14 +115,14 @@ async fn clone_project( git::fetch(src, format!("{}/{}", dst, &p_path), only_master).await?; - info!("start pushing"); - let (backup_gl, backup_group, backup_git_http_auth) = if let Some(backup) = backup { (&backup.client, &backup.group, &backup.git_http_auth) } else { return Ok(()); }; + info!("start pushing"); + let path: Vec = if disable_hierarchy { vec![p_path.clone()] } else { @@ -239,7 +239,7 @@ pub async fn clone(p: CloneParams) -> Result<()> { pb.message("Cloning: "); for chunk in projects.chunks(p.concurrency_limit) { - join_all(chunk.iter().map(|pr| { + try_join_all(chunk.iter().map(|pr| { clone_project( pr, &dst, @@ -249,7 +249,7 @@ pub async fn clone(p: CloneParams) -> Result<()> { p.disable_hierarchy, ) })) - .await; + .await?; pb.add(chunk.len() as u64); }