MCPcopy Create free account
hub / github.com/hashintel/hash / healthcheck

Function healthcheck

apps/hash-graph/src/subcommand/server.rs:490–504  ·  view source on GitHub ↗
(address: HttpAddress)

Source from the content-addressed store, hash-verified

488}
489
490pub async fn healthcheck(address: HttpAddress) -> Result<(), Report<HealthcheckError>> {
491 let request_url = format!("http://{address}/health");
492
493 timeout(
494 Duration::from_secs(10),
495 Client::new().head(&request_url).send(),
496 )
497 .await
498 .change_context(HealthcheckError::Timeout)?
499 .change_context(HealthcheckError::NotHealthy)?
500 .error_for_status()
501 .change_context(HealthcheckError::NotHealthy)?;
502
503 Ok(())
504}

Callers 1

serverFunction · 0.70

Calls 3

OkInterface · 0.85
sendMethod · 0.65
change_contextMethod · 0.45

Tested by

no test coverage detected