(r string, wg *sync.WaitGroup, semaphore chan struct{})
| 2730 | } |
| 2731 | |
| 2732 | func (m *Inventory2Module) getCodeDeployDeploymentsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) { |
| 2733 | defer func() { |
| 2734 | wg.Done() |
| 2735 | m.CommandCounter.DecrExecuting() |
| 2736 | m.CommandCounter.IncrComplete() |
| 2737 | }() |
| 2738 | semaphore <- struct{}{} |
| 2739 | defer func() { |
| 2740 | <-semaphore |
| 2741 | }() |
| 2742 | // m.CommandCounter.IncrTotal() |
| 2743 | m.CommandCounter.DecrPending() |
| 2744 | m.CommandCounter.IncrExecuting() |
| 2745 | var totalCountThisServiceThisRegion = 0 |
| 2746 | var service = "CodeDeploy Deployments" |
| 2747 | var resourceNames []string |
| 2748 | |
| 2749 | deployments, err := sdk.CachedCodeDeployListDeployments(m.CodeDeployClient, aws.ToString(m.Caller.Account), r) |
| 2750 | if err != nil { |
| 2751 | m.modLog.Error(err.Error()) |
| 2752 | m.CommandCounter.IncrError() |
| 2753 | return |
| 2754 | |
| 2755 | } |
| 2756 | |
| 2757 | // Add this page of resources to the total count |
| 2758 | totalCountThisServiceThisRegion = totalCountThisServiceThisRegion + len(deployments) |
| 2759 | |
| 2760 | // Add this page of resources to the module's resource list |
| 2761 | for _, d := range deployments { |
| 2762 | arn := "arn:aws:codedeploy:" + r + ":" + aws.ToString(m.Caller.Account) + ":application:" + d |
| 2763 | resourceNames = append(resourceNames, arn) |
| 2764 | } |
| 2765 | |
| 2766 | m.mu.Lock() |
| 2767 | m.resources = append(m.resources, resourceNames...) |
| 2768 | m.serviceMap[service][r] = totalCountThisServiceThisRegion |
| 2769 | m.totalRegionCounts[r] = m.totalRegionCounts[r] + totalCountThisServiceThisRegion |
| 2770 | m.serviceMap["total"][r] = m.serviceMap["total"][r] + totalCountThisServiceThisRegion |
| 2771 | m.mu.Unlock() |
| 2772 | } |
| 2773 | |
| 2774 | func (m *Inventory2Module) getDataPipelinePipelinesPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) { |
| 2775 | defer func() { |
no test coverage detected