From 533afcf4e13022c46fd21ec51ca2a9969692ef4c Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sun, 11 Dec 2022 18:17:08 +0100 Subject: simplify --- src/api/admin/cluster.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src') diff --git a/src/api/admin/cluster.rs b/src/api/admin/cluster.rs index f4bf8b7b..182a4f6f 100644 --- a/src/api/admin/cluster.rs +++ b/src/api/admin/cluster.rs @@ -9,7 +9,6 @@ use garage_util::crdt::*; use garage_util::data::*; use garage_rpc::layout::*; -use garage_rpc::system::ClusterHealthStatus; use garage_model::garage::Garage; @@ -46,13 +45,7 @@ pub async fn handle_get_cluster_status(garage: &Arc) -> Result) -> Result, Error> { let health = garage.system.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))?) + Ok(json_ok_response(&health)?) } pub async fn handle_connect_cluster_nodes( -- cgit v1.2.3