mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-13 23:34:54 +00:00
Fix /health REST API panic (#763)
* fix: panic in REST health endpoint to running node without RLN * chore: change title of each API file
This commit is contained in:
parent
d317b294a0
commit
3254d28968
@ -1,6 +1,6 @@
|
|||||||
openapi: 3.0.3
|
openapi: 3.0.3
|
||||||
info:
|
info:
|
||||||
title: Waku V2 node REST API
|
title: Waku V2 node Debug REST API
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
contact:
|
contact:
|
||||||
name: VAC Team
|
name: VAC Team
|
||||||
|
@ -30,6 +30,7 @@ func NewHealthService(node *node.WakuNode, m *chi.Mux) *HealthService {
|
|||||||
type HealthResponse string
|
type HealthResponse string
|
||||||
|
|
||||||
func (d *HealthService) getHealth(w http.ResponseWriter, r *http.Request) {
|
func (d *HealthService) getHealth(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if d.node.RLNRelay() != nil {
|
||||||
isReady, err := d.node.RLNRelay().IsReady(r.Context())
|
isReady, err := d.node.RLNRelay().IsReady(r.Context())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, context.DeadlineExceeded) {
|
if errors.Is(err, context.DeadlineExceeded) {
|
||||||
@ -45,4 +46,7 @@ func (d *HealthService) getHealth(w http.ResponseWriter, r *http.Request) {
|
|||||||
} else {
|
} else {
|
||||||
writeResponse(w, HealthResponse("Node is not ready"), http.StatusInternalServerError)
|
writeResponse(w, HealthResponse("Node is not ready"), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
writeResponse(w, HealthResponse("Non RLN healthcheck is not implemented"), http.StatusNotImplemented)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
openapi: 3.0.3
|
openapi: 3.0.3
|
||||||
info:
|
info:
|
||||||
title: Waku V2 node REST API
|
title: Waku V2 node Health REST API
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
contact:
|
contact:
|
||||||
name: VAC Team
|
name: VAC Team
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
openapi: 3.0.3
|
openapi: 3.0.3
|
||||||
info:
|
info:
|
||||||
title: Waku V2 node REST API
|
title: Waku V2 node Relay REST API
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
contact:
|
contact:
|
||||||
name: VAC Team
|
name: VAC Team
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
openapi: 3.0.3
|
openapi: 3.0.3
|
||||||
info:
|
info:
|
||||||
title: Waku V2 node REST API
|
title: Waku V2 node Store REST API
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
contact:
|
contact:
|
||||||
name: VAC Team
|
name: VAC Team
|
||||||
|
Loading…
x
Reference in New Issue
Block a user