diff --git a/src/server/actors/repo/branch.rs b/src/server/actors/repo/branch.rs index b54a00d..dc77fab 100644 --- a/src/server/actors/repo/branch.rs +++ b/src/server/actors/repo/branch.rs @@ -6,12 +6,12 @@ use kxio::network; use tracing::{error, info, warn}; use crate::server::{ - actors::repo::branch, + actors::repo::{branch, ValidateRepo}, config::{self, BranchName}, forge, }; -use super::{RepoActor, StartMonitoring, StartRepo}; +use super::{RepoActor, StartMonitoring}; #[tracing::instrument(fields(forge_name = %repo_details.forge.name, repo_name = %repo_details.name), skip_all)] pub async fn validate_positions( @@ -52,6 +52,8 @@ pub async fn validate_positions( ) .is_ok() { + // TODO : (#18) sleep and restart while we don't have webhooks + tokio::time::sleep(std::time::Duration::from_secs(10)).await; addr.do_send(super::ValidateRepo) } return; @@ -121,6 +123,8 @@ pub async fn advance_next( warn!("No commits to advance next to"); return; }; + // TODO: (#33) get commit message for 'commit' + // TODO: (#33) verify commit message is valid match reset( &repo_config.branches().next(), commit, @@ -129,8 +133,9 @@ pub async fn advance_next( ) { Ok(_) => { info!("Success"); + // TODO : (#18) sleep and restart while we don't have webhooks tokio::time::sleep(std::time::Duration::from_secs(10)).await; - addr.do_send(StartRepo); + addr.do_send(ValidateRepo); } Err(err) => { warn!(?err, "Failed") diff --git a/src/server/actors/repo/status.rs b/src/server/actors/repo/status.rs index 11b04f4..851e415 100644 --- a/src/server/actors/repo/status.rs +++ b/src/server/actors/repo/status.rs @@ -34,6 +34,7 @@ pub async fn check_next( warn!("Checks have failed"); } } + // TODO : (#18) sleep and restart while we don't have webhooks tokio::time::sleep(std::time::Duration::from_secs(10)).await; addr.do_send(ValidateRepo); }