(ctx context.Context, nodes []*cluster_dto.Node)
| 10 | ) |
| 11 | |
| 12 | func 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 | } |
| 29 | func doPingRouting(ctx context.Context, n *cluster_dto.Node, wg *sync.WaitGroup) { |
| 30 | n.Status = ping(ctx, n.Admins...) |
| 31 | wg.Done() |
no test coverage detected