(address: HttpAddress)
| 488 | } |
| 489 | |
| 490 | pub 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 | } |
no test coverage detected