Skip to content

Commit

Permalink
feat: consider serivice healthy on response
Browse files Browse the repository at this point in the history
  • Loading branch information
taco-paco committed Oct 18, 2024
1 parent 9095187 commit 603eac6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 1 addition & 0 deletions api/src/handlers/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ pub async fn do_compile(
.action_successes_total
.with_label_values(&[COMPILATION_LABEL_VALUE])
.inc();

Ok(Json(CompileResponse {
file_content: file_contents,
status: status_code_to_message(status.code()),
Expand Down
9 changes: 1 addition & 8 deletions api/src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ lazy_static! {
#[get("/health")]
pub async fn health(engine: &State<WorkerEngine>) -> HealthCheckResponse {
info!("/health");

let result = do_compile(generate_mock_compile_request(), &engine.metrics).await;

if result.is_ok() {
HealthCheckResponse::ok()
} else {
HealthCheckResponse::error("Failed to compile")
}
HealthCheckResponse::ok()
}

#[instrument]
Expand Down

0 comments on commit 603eac6

Please sign in to comment.