MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / nodeStatus

Function nodeStatus

module/cluster/util.go:12–28  ·  view source on GitHub ↗
(ctx context.Context, nodes []*cluster_dto.Node)

Source from the content-addressed store, hash-verified

10)
11
12func nodeStatus(ctx context.Context, nodes []*cluster_dto.Node) {
13 if len(nodes) == 0 {
14 return
15 }
16
17 if len(nodes) == 1 {
18 nodes[0].Status = ping(ctx, nodes[0].Admins...)
19 }
20
21 wg := sync.WaitGroup{}
22 wg.Add(len(nodes))
23
24 for _, n := range nodes {
25 go doPingRouting(ctx, n, &wg)
26 }
27 wg.Wait()
28}
29func doPingRouting(ctx context.Context, n *cluster_dto.Node, wg *sync.WaitGroup) {
30 n.Status = ping(ctx, n.Admins...)
31 wg.Done()

Callers 3

CheckClusterMethod · 0.85
ResetClusterMethod · 0.85
ClusterNodesMethod · 0.85

Calls 2

pingFunction · 0.85
doPingRoutingFunction · 0.85

Tested by

no test coverage detected