forked from kemitix/git-next
23 lines
570 B
Rust
23 lines
570 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");
|
||
|
}
|
||
|
}
|
||
|
}
|