hive-c0re: spawn the auto-update and knowledge git calls through git_command
Three git spawns in workers/auto_update.rs and workers/knowledge.rs used a bare tokio Command, so they ignored HYPERHIVE_GIT and, when the job queue's deadline dropped their future (the knowledge pull has a 5 minute one), the git child was left running instead of killed. They now use lifecycle::git_command(), as the other git calls in knowledge.rs already do.
This commit is contained in:
parent
a2a94f63c8
commit
e59a2a34fb
2 changed files with 3 additions and 3 deletions
|
|
@ -51,7 +51,7 @@ pub fn current_flake_rev(hyperhive_flake: &str) -> Option<String> {
|
|||
/// starved the runtime and stalled the per-agent sockets.
|
||||
pub async fn agent_config_pending(name: &str, deployed_sha: Option<&str>) -> bool {
|
||||
let applied = crate::paths::applied_dir(name);
|
||||
let applied_head = tokio::process::Command::new("git")
|
||||
let applied_head = crate::lifecycle::git_command()
|
||||
.args(["-C", &applied.to_string_lossy(), "rev-parse", "HEAD"])
|
||||
.output()
|
||||
.await
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ async fn ensure_local_clone(auth: Option<&str>) -> Result<()> {
|
|||
/// failure (used only to detect whether a pull actually moved `HEAD` —
|
||||
/// worth skipping the broadcast over, not worth failing the pull for).
|
||||
async fn head_sha() -> Option<String> {
|
||||
let out = tokio::process::Command::new("git")
|
||||
let out = crate::lifecycle::git_command()
|
||||
.args(["-C", LOCAL_DIR, "rev-parse", "HEAD"])
|
||||
.output()
|
||||
.await
|
||||
|
|
@ -186,7 +186,7 @@ pub async fn pull(coord: &Coordinator) -> Result<()> {
|
|||
/// summary to every live agent. Best-effort — a diff or send failure is
|
||||
/// logged, never propagated (the pull itself already succeeded).
|
||||
async fn broadcast_change(coord: &Coordinator, before: &str, after: &str) {
|
||||
let diff = tokio::process::Command::new("git")
|
||||
let diff = crate::lifecycle::git_command()
|
||||
.args([
|
||||
"-C",
|
||||
LOCAL_DIR,
|
||||
|
|
|
|||
Loading…
Reference in a new issue