From 012bf0593df7bf93afb73db5c87dd8ccc36e851f Mon Sep 17 00:00:00 2001 From: Max Audron Date: Tue, 7 Jun 2022 12:28:18 +0200 Subject: move to mostly sync architecture the git repository struct is not sharable between threads, thus go single threaded for now and only call onto the tokio runtime for lookups towards gitlab. --- src/repo/mod.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/repo/mod.rs') diff --git a/src/repo/mod.rs b/src/repo/mod.rs index e3d1279..aaf0177 100644 --- a/src/repo/mod.rs +++ b/src/repo/mod.rs @@ -1,4 +1,9 @@ -use std::{fmt::Debug, path::PathBuf}; +use std::{ + collections::HashMap, + fmt::Debug, + path::PathBuf, + sync::RwLock, +}; use thiserror::Error; @@ -13,7 +18,8 @@ mod repostate; pub use aggregate::*; pub use repostate::*; -pub type Repos = Vec; +// pub type Repos = Vec; +pub type Repos = HashMap>; pub struct Repo { pub name: String, @@ -83,9 +89,7 @@ impl Repo { let mut builder = git2::build::RepoBuilder::new(); builder.fetch_options(crate::git::fetch_options()); - builder - .clone(url, &self.path) - .map_err(RepoError::GitError) + builder.clone(url, &self.path).map_err(RepoError::GitError) } #[tracing::instrument(level = "trace")] -- cgit v1.2.3