git-next/src/server/actors/repo/config.rs

22 lines
571 B
Rust

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<RepoActor>, net: Network) {
let config = match details.forge.forge_type {
ForgeType::ForgeJo => forge::forgejo::config::load(&details, &net).await,
};
match config {
Ok(config) => addr.do_send(LoadedConfig(config)),
Err(err) => {
error!(?err, "Failed to load config");
}
}
}