aboutsummaryrefslogtreecommitdiff
path: root/src/forge
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2022-06-07 12:28:18 +0200
committerMaximilian Manz <maximilian.manz@de.clara.net>2022-06-20 11:33:04 +0200
commit012bf0593df7bf93afb73db5c87dd8ccc36e851f (patch)
tree7606ed25710a058012e8ffb8bda736bbfd6a1a3f /src/forge
parentreorganize file structure and cleanup lints (diff)
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.
Diffstat (limited to 'src/forge')
-rw-r--r--src/forge/gitlab/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/forge/gitlab/mod.rs b/src/forge/gitlab/mod.rs
index fac60b7..dec3b49 100644
--- a/src/forge/gitlab/mod.rs
+++ b/src/forge/gitlab/mod.rs
@@ -1,5 +1,4 @@
use anyhow::Result;
-use gitlab::AsyncGitlab;
use graphql_client::GraphQLQuery;
@@ -7,10 +6,11 @@ pub mod config;
#[derive(Clone, Debug)]
pub struct Gitlab {
- client: AsyncGitlab,
+ client: gitlab::AsyncGitlab,
}
impl Gitlab {
+ #[tracing::instrument(level = "trace")]
pub async fn new(host: &str, token: &str, tls: bool) -> Result<Gitlab> {
let mut gitlab = gitlab::GitlabBuilder::new(host, token);
@@ -23,6 +23,7 @@ impl Gitlab {
Ok(Gitlab { client: gitlab })
}
+ #[tracing::instrument(level = "trace")]
pub async fn from_config(forge: &config::Gitlab) -> Result<Gitlab> {
Gitlab::new(&forge.host, &forge.token, forge.tls).await
}