Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed May 15, 2024
1 parent f3c5e42 commit abc8e12
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions catalyst-gateway/bin/src/service/api/health/live_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub(crate) fn set_live(flag: bool) {
IS_LIVE.store(flag, Ordering::Relaxed);
}
/// Get the started flag
#[allow(dead_code)]
fn is_live() -> bool {
IS_LIVE.load(Ordering::Relaxed)
}
Expand All @@ -27,6 +28,7 @@ pub(crate) enum Responses {
NoContent,
/// Service is possibly not running reliably.
#[oai(status = 503)]
#[allow(dead_code)]
ServiceUnavailable,
}

Expand All @@ -44,9 +46,5 @@ pub(crate) type AllResponses = WithErrorResponses<Responses>;
/// by an endpoint in a short window.
#[allow(clippy::unused_async)]
pub(crate) async fn endpoint() -> AllResponses {
if is_live() {
Responses::NoContent.into()
} else {
Responses::ServiceUnavailable.into()
}
Responses::NoContent.into()
}

0 comments on commit abc8e12

Please sign in to comment.