diff --git a/src/api/server.rs b/src/api/server.rs index 04d6b69..8257924 100644 --- a/src/api/server.rs +++ b/src/api/server.rs @@ -480,6 +480,8 @@ struct PipelineStatus { gdino_api: ServiceStatus, /// LLM via llama.cpp (port 8082) llm: ServiceStatus, + /// rsync file sync tool + rsync: ServiceStatus, } #[derive(Debug, Serialize)] @@ -589,6 +591,7 @@ async fn health_detailed(State(state): State) -> Json ServiceStatus { } } +async fn check_binary(name: &str) -> ServiceStatus { + let start = Instant::now(); + match std::process::Command::new("which").arg(name).output() { + Ok(output) if output.status.success() => ServiceStatus { + status: "ok".to_string(), + latency_ms: Some(start.elapsed().as_millis() as u64), + error: None, + }, + _ => ServiceStatus { + status: "error".to_string(), + latency_ms: Some(start.elapsed().as_millis() as u64), + error: Some(format!("{} not found in PATH", name)), + }, + } +} + async fn check_http(url: &str) -> ServiceStatus { let start = Instant::now(); match reqwest::get(url).await {