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

25 lines
542 B
Rust
Raw Normal View History

use actix::prelude::*;
use crate::server::{
config::{self, ForgeType},
forge,
};
use super::AdvanceMainTo;
pub async fn check_next(
next: forge::Commit,
repo_details: config::RepoDetails,
addr: Addr<super::RepoActor>,
net: kxio::network::Network,
) {
let is_success = match repo_details.forge.forge_type {
ForgeType::ForgeJo => {
forge::forgejo::get_commit_status(next.clone(), repo_details, net).await
}
};
if is_success {
addr.do_send(AdvanceMainTo(next));
}
}