From fe16a923190243dfde5db6ceff2ef0bcf9158926 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Tue, 1 Oct 2024 13:15:24 -0500 Subject: feat: simplify service status type --- src/api.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/api.rs') diff --git a/src/api.rs b/src/api.rs index 1489c21..5a8deb6 100644 --- a/src/api.rs +++ b/src/api.rs @@ -45,12 +45,12 @@ pub async fn healthcheck(State(services): State) -> Health { let status = match checks .values() - .filter(|s| !matches!(s, Status::Pass)) + .filter(|s| !matches!(s, Status::Ok)) .count() { - 0 => Status::Pass, - 1 => Status::Fail(Some("1 issue detected".to_string())), - n => Status::Fail(Some(format!("{n} issues detected"))), + 0 => Status::Ok, + 1 => Status::Error(Some("1 issue detected".to_string())), + n => Status::Error(Some(format!("{n} issues detected"))), }; Health { status, checks } -- cgit v1.2.3-70-g09d2