Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pschork committed May 11, 2024
1 parent d0febd9 commit 073ba2e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,9 @@ func (n *Node) checkCurrentNodeIp(ctx context.Context) {
}
}

// OperatorReachabilityResponse is the response object for the reachability check
type OperatorReachabilityResponse struct {
OperatorId string `json:"operator_id"`
OperatorID string `json:"operator_id"`
DispersalSocket string `json:"dispersal_socket"`
RetrievalSocket string `json:"retrieval_socket"`
DispersalOnline bool `json:"dispersal_online"`
Expand Down Expand Up @@ -511,13 +512,17 @@ func (n *Node) checkNodeReachability() {
}

var responseObject OperatorReachabilityResponse
json.Unmarshal(data, &responseObject)
err = json.Unmarshal(data, &responseObject)
if err != nil {
n.Logger.Error("Reachability check failed to unmarshal json response", err)
continue
}

if responseObject.DispersalOnline {
n.Logger.Info("Reachability check - dispersal socket is ONLINE", "socket", responseObject.DispersalSocket)
} else {
n.Logger.Error("Reachability check - dispersal socket is UNREACHABLE", "socket", responseObject.DispersalSocket)
}

if responseObject.RetrievalOnline {
n.Logger.Info("Reachability check - retrieval socket is ONLINE", "socket", responseObject.RetrievalSocket)
} else {
Expand Down

0 comments on commit 073ba2e

Please sign in to comment.