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/update/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/update/mod.rs') diff --git a/src/update/mod.rs b/src/update/mod.rs index dfc800c..609b35e 100644 --- a/src/update/mod.rs +++ b/src/update/mod.rs @@ -6,8 +6,10 @@ use tracing::debug; use crate::repo::{Repo, RepoError, Repos}; impl crate::GTree { - pub async fn update(&self, repos: Repos) { - for mut repo in repos { + pub fn update(&self, repos: Repos) { + for (name, repo) in repos { + let mut repo = repo.write().unwrap(); + if repo.repo.is_some() { match repo.update() { Ok(u) => println!("{}", u), -- cgit v1.2.3