(r string, wg *sync.WaitGroup, semaphore chan struct{})
| 2561 | } |
| 2562 | |
| 2563 | func (m *Inventory2Module) getCodeArtifactDomainsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) { |
| 2564 | defer func() { |
| 2565 | wg.Done() |
| 2566 | m.CommandCounter.DecrExecuting() |
| 2567 | m.CommandCounter.IncrComplete() |
| 2568 | }() |
| 2569 | semaphore <- struct{}{} |
| 2570 | defer func() { |
| 2571 | <-semaphore |
| 2572 | }() |
| 2573 | // m.CommandCounter.IncrTotal() |
| 2574 | m.CommandCounter.DecrPending() |
| 2575 | m.CommandCounter.IncrExecuting() |
| 2576 | var totalCountThisServiceThisRegion = 0 |
| 2577 | var service = "CodeArtifact Domains" |
| 2578 | var resourceNames []string |
| 2579 | |
| 2580 | Domains, err := sdk.CachedCodeArtifactListDomains(m.CodeArtifactClient, aws.ToString(m.Caller.Account), r) |
| 2581 | if err != nil { |
| 2582 | m.modLog.Error(err.Error()) |
| 2583 | m.CommandCounter.IncrError() |
| 2584 | return |
| 2585 | } |
| 2586 | |
| 2587 | // Add this page of resources to the total count |
| 2588 | totalCountThisServiceThisRegion = totalCountThisServiceThisRegion + len(Domains) |
| 2589 | |
| 2590 | // Add this page of resources to the module's resource list |
| 2591 | for _, domain := range Domains { |
| 2592 | arn := aws.ToString(domain.Arn) |
| 2593 | resourceNames = append(resourceNames, arn) |
| 2594 | } |
| 2595 | |
| 2596 | // No more pages, update the module's service map |
| 2597 | m.mu.Lock() |
| 2598 | m.resources = append(m.resources, resourceNames...) |
| 2599 | m.serviceMap[service][r] = totalCountThisServiceThisRegion |
| 2600 | m.totalRegionCounts[r] = m.totalRegionCounts[r] + totalCountThisServiceThisRegion |
| 2601 | m.serviceMap["total"][r] = m.serviceMap["total"][r] + totalCountThisServiceThisRegion |
| 2602 | |
| 2603 | m.mu.Unlock() |
| 2604 | } |
| 2605 | |
| 2606 | func (m *Inventory2Module) getCodeBuildProjectsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) { |
| 2607 | defer func() { |
no test coverage detected