use actix::prelude::*; use kxio::network::Network; use tracing::error; use crate::server::{ config::{ForgeType, RepoDetails}, forge, }; use super::{LoadedConfig, RepoActor}; pub async fn load(details: RepoDetails, addr: Addr, net: Network) { let config = match details.forge.forge_type { #[cfg(feature = "forgejo")] ForgeType::ForgeJo => forge::forgejo::config::load(&details, &net).await, #[cfg(test)] ForgeType::MockForge => forge::mock::config::load(&details, &net).await, }; match config { Ok(config) => addr.do_send(LoadedConfig(config)), Err(err) => { error!(?err, "Failed to load config"); } } }