fix: rsync pipeline check looks for source-built binary at ~/bin/rsync
This commit is contained in:
@@ -591,7 +591,7 @@ async fn health_detailed(State(state): State<AppState>) -> Json<DetailedHealthRe
|
||||
embedding_server: check_http("http://127.0.0.1:11436/health").await,
|
||||
gdino_api: check_http("http://127.0.0.1:8080/health").await,
|
||||
llm: check_http("http://127.0.0.1:8082/health").await,
|
||||
rsync: check_binary("rsync").await,
|
||||
rsync: check_rsync().await,
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -726,6 +726,28 @@ async fn check_mongodb(cache: &MongoCache) -> 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() {
|
||||
|
||||
Reference in New Issue
Block a user