Skip to content

Commit

Permalink
Update substrate/client/rpc-servers/src/middleware/node_health.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Bastian Köcher <[email protected]>
  • Loading branch information
yjhmelody and bkchr authored Sep 19, 2024
1 parent 485a300 commit 6842490
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions substrate/client/rpc-servers/src/middleware/node_health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ where
InterceptRequest::Deny => {
http_response(StatusCode::METHOD_NOT_ALLOWED, HttpBody::empty())
},
InterceptRequest::No => fut.await.map_err(|err| err.into())?,
InterceptRequest::No => fut.await?,

Check failure on line 105 in substrate/client/rpc-servers/src/middleware/node_health.rs

View workflow job for this annotation

GitHub Actions / cargo-check-all-crate-macos

the trait bound `<S as tower::Service<hyper::Request<HttpBody>>>::Error: StdError` is not satisfied

Check failure on line 105 in substrate/client/rpc-servers/src/middleware/node_health.rs

View workflow job for this annotation

GitHub Actions / cargo-check-all-crate-macos

`<S as tower::Service<hyper::Request<HttpBody>>>::Error` cannot be sent between threads safely

Check failure on line 105 in substrate/client/rpc-servers/src/middleware/node_health.rs

View workflow job for this annotation

GitHub Actions / cargo-check-all-crate-macos

`<S as tower::Service<hyper::Request<HttpBody>>>::Error` cannot be shared between threads safely
InterceptRequest::Health => {
let res = fut.await.map_err(|err| err.into())?;
let res = fut.await?;
let health = parse_rpc_response(res.into_body()).await?;
http_ok_response(serde_json::to_string(&health)?)
},
InterceptRequest::Readiness => {
let res = fut.await.map_err(|err| err.into())?;
let res = fut.await?;
let health = parse_rpc_response(res.into_body()).await?;
if (!health.is_syncing && health.peers > 0) || !health.should_have_peers {
http_ok_response(HttpBody::empty())
Expand Down

0 comments on commit 6842490

Please sign in to comment.