Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller, swarm-ci-metrics: build forge clients through forge-client

This commit is contained in:
atlas 2026-11-15 23:02:54 +01:00
commit a77131ca3f

View file

@ -19,8 +19,9 @@ use std::path::{Path, PathBuf};
use std::time::Duration;
use anyhow::{Context as _, Result, bail};
use forge_client::{StaticToken, async_client};
use forgejo_api::Forgejo;
use forgejo_api::structs::{ActionRun, ListActionRunsQuery, RepoSearchQuery};
use forgejo_api::{Auth, Forgejo};
use swarm_queue_client::{ClientSecret, QueueConfig};
use swarm_secret_client::ci_metrics::{ClientSecret as StoredClientSecret, client_secret_path};
use swarm_secret_client::client::ENV_CLIENT_CERT;
@ -84,8 +85,11 @@ async fn main() -> Result<()> {
state_file: PathBuf::from(state_dir).join("cursor.json"),
};
let forge = Forgejo::new(Auth::Token(&forge_token().await?), cfg.forge_url.clone())
.context("building the forge client")?;
let forge = async_client(
cfg.forge_url.clone(),
&StaticToken::new(forge_token().await?),
)
.context("building the forge client")?;
let http = reqwest::Client::builder()
.timeout(Duration::from_secs(30))
.build()