diff --git a/src/api/server.rs b/src/api/server.rs index 8257924..ab27640 100644 --- a/src/api/server.rs +++ b/src/api/server.rs @@ -591,7 +591,7 @@ async fn health_detailed(State(state): State) -> Json ServiceStatus { } } +async fn check_rsync() -> ServiceStatus { + let start = Instant::now(); + let paths = [ + std::path::Path::new("/Users/accusys/bin/rsync"), + std::path::Path::new("/opt/homebrew/bin/rsync"), + ]; + for p in &paths { + if p.exists() { + return 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("rsync not found (built from source expected at ~/bin/rsync)".to_string()), + } +} + async fn check_binary(name: &str) -> ServiceStatus { let start = Instant::now(); match std::process::Command::new("which").arg(name).output() {