Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
d31bb8ac
Unverified
Commit
d31bb8ac
authored
6 months ago
by
yjh
Committed by
GitHub
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: fast return for invalid request of node health (#5762)
Co-authored-by: command-bot <>
parent
b230b0e3
Branches
gh-readonly-queue/master/pr-3071-7f28ac620493c66e8907e4dce2897cb04279cb13
Branches containing commit
No related merge requests found
Pipeline
#497865
waiting for manual action with stages
in 1 hour, 24 minutes, and 23 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
prdoc/pr_5762.prdoc
+10
-0
10 additions, 0 deletions
prdoc/pr_5762.prdoc
substrate/client/rpc-servers/src/middleware/node_health.rs
+3
-3
3 additions, 3 deletions
substrate/client/rpc-servers/src/middleware/node_health.rs
with
13 additions
and
3 deletions
prdoc/pr_5762.prdoc
0 → 100644
+
10
−
0
View file @
d31bb8ac
title: Fast return for invalid request of node health
doc:
- audience: Node Dev
description: |
Return directly when invalid request for node health api
crates:
- name: sc-rpc-server
bump: patch
This diff is collapsed.
Click to expand it.
substrate/client/rpc-servers/src/middleware/node_health.rs
+
3
−
3
View file @
d31bb8ac
...
...
@@ -98,17 +98,17 @@ where
let
fut
=
self
.0
.call
(
req
);
async
move
{
let
res
=
fut
.await
.map_err
(|
err
|
err
.into
())
?
;
Ok
(
match
maybe_intercept
{
InterceptRequest
::
Deny
=>
http_response
(
StatusCode
::
METHOD_NOT_ALLOWED
,
HttpBody
::
empty
()),
InterceptRequest
::
No
=>
res
,
InterceptRequest
::
No
=>
fut
.await
.map_err
(|
err
|
err
.into
())
?
,
InterceptRequest
::
Health
=>
{
let
res
=
fut
.await
.map_err
(|
err
|
err
.into
())
?
;
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
health
=
parse_rpc_response
(
res
.into_body
())
.await
?
;
if
(
!
health
.is_syncing
&&
health
.peers
>
0
)
||
!
health
.should_have_peers
{
http_ok_response
(
HttpBody
::
empty
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment