objectstore_server/
healthcheck.rs1use anyhow::Result;
4
5use crate::config::Config;
6
7pub async fn healthcheck(config: Config) -> Result<()> {
12 let client = reqwest::Client::new();
13 let url = format!("http://{}/health", config.http_addr);
14
15 objectstore_log::debug!("sending healthcheck request to {}", url);
16 let response = client.get(&url).send().await?;
17 if !response.status().is_success() {
18 anyhow::bail!("Bad Status: {}", response.status());
19 }
20
21 objectstore_log::info!("OK");
22 Ok(())
23}