simplify
This commit is contained in:
parent
5ea5fd2130
commit
533afcf4e1
@ -9,7 +9,6 @@ use garage_util::crdt::*;
|
|||||||
use garage_util::data::*;
|
use garage_util::data::*;
|
||||||
|
|
||||||
use garage_rpc::layout::*;
|
use garage_rpc::layout::*;
|
||||||
use garage_rpc::system::ClusterHealthStatus;
|
|
||||||
|
|
||||||
use garage_model::garage::Garage;
|
use garage_model::garage::Garage;
|
||||||
|
|
||||||
@ -46,13 +45,7 @@ pub async fn handle_get_cluster_status(garage: &Arc<Garage>) -> Result<Response<
|
|||||||
|
|
||||||
pub async fn handle_get_cluster_health(garage: &Arc<Garage>) -> Result<Response<Body>, Error> {
|
pub async fn handle_get_cluster_health(garage: &Arc<Garage>) -> Result<Response<Body>, Error> {
|
||||||
let health = garage.system.health();
|
let health = garage.system.health();
|
||||||
|
Ok(json_ok_response(&health)?)
|
||||||
let resp_json =
|
|
||||||
serde_json::to_string_pretty(&health).map_err(garage_util::error::Error::from)?;
|
|
||||||
Ok(Response::builder()
|
|
||||||
.status(StatusCode::OK)
|
|
||||||
.header(http::header::CONTENT_TYPE, "application/json")
|
|
||||||
.body(Body::from(resp_json))?)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn handle_connect_cluster_nodes(
|
pub async fn handle_connect_cluster_nodes(
|
||||||
|
Loading…
Reference in New Issue
Block a user