Skip to content

Commit

Permalink
- change the order of execution to avoid conflicts with prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
laststylebender14 committed Sep 18, 2024
1 parent a955d2d commit d7fcb88
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/core/http/request_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ async fn handle_request_inner<T: DeserializeOwned + GraphQLRequestLike>(

graphql_request::<T>(req, &Arc::new(app_ctx), req_counter).await
}

hyper::Method::GET if req.uri().path() == "/status" => {
let status_response = Response::builder()
.status(StatusCode::OK)
.header(CONTENT_TYPE, "application/json")
.body(Body::from(r#"{"message": "ready"}"#))?;
return Ok(status_response);

Check failure on line 329 in src/core/http/request_handler.rs

View workflow job for this annotation

GitHub Actions / Run Formatter and Lint Check

unneeded `return` statement
}
hyper::Method::GET => {
if let Some(TelemetryExporter::Prometheus(prometheus)) =
app_ctx.blueprint.telemetry.export.as_ref()
Expand All @@ -330,15 +336,6 @@ async fn handle_request_inner<T: DeserializeOwned + GraphQLRequestLike>(
return prometheus_metrics(prometheus);
}
};

if req.uri().path() == "/status" {
let status_response = Response::builder()
.status(StatusCode::OK)
.header(CONTENT_TYPE, "application/json")
.body(Body::from(r#"{"message": "ready"}"#))?;
return Ok(status_response);
}

not_found()
}
_ => not_found(),
Expand Down

0 comments on commit d7fcb88

Please sign in to comment.