// use actix::prelude::*; use git_next_git as git; use git_next_gitforge::{CommitStatus, Forge, MessageToken}; use tracing::{info, warn}; use crate::ValidateRepo; use super::AdvanceMainTo; pub async fn check_next( next: git::Commit, addr: Addr, forge: Forge, message_token: MessageToken, ) { // get the status - pass, fail, pending (all others map to fail, e.g. error) let status = forge.commit_status(&next).await; info!(?status, "Checking next branch"); match status { CommitStatus::Pass => { addr.do_send(AdvanceMainTo(next)); } CommitStatus::Pending => { tokio::time::sleep(tokio::time::Duration::from_secs(10)).await; addr.do_send(ValidateRepo { message_token }); } CommitStatus::Fail => { warn!("Checks have failed"); } } }