From 9469d274767d335e1eb95b2969643b071400651b Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 10 Apr 2024 22:40:33 +0100 Subject: [PATCH] fix(server): Pause before checking CI status when just updated branch If we check the status of the commit as soon as we push we get a Pass before the CI tests have even started. Wait briefly (10 seconds) to allow the CI to start and set the status to pending. Closes kemitix/git-next#24 --- Cargo.toml | 1 + src/server/actors/repo/branch.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 1fc942a..25e55af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,7 @@ terrors = "0.3" # Actors actix = "0.13" actix-rt = "2.9" +tokio = { version = "1.37", features = ["full"] } [dev-dependencies] # Testing diff --git a/src/server/actors/repo/branch.rs b/src/server/actors/repo/branch.rs index 6d7456a..d0e0b67 100644 --- a/src/server/actors/repo/branch.rs +++ b/src/server/actors/repo/branch.rs @@ -111,6 +111,7 @@ pub async fn advance_next( match child.wait() { Ok(exit_status) => { info!(%exit_status, "Advance Next Success"); + tokio::time::sleep(std::time::Duration::from_secs(10)).await; addr.do_send(StartRepo); } Err(err) => {