(r string, wg *sync.WaitGroup, semaphore chan struct{})
| 801 | } |
| 802 | |
| 803 | func (m *Inventory2Module) getLambdaFunctionsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) { |
| 804 | defer func() { |
| 805 | wg.Done() |
| 806 | m.CommandCounter.DecrExecuting() |
| 807 | m.CommandCounter.IncrComplete() |
| 808 | }() |
| 809 | semaphore <- struct{}{} |
| 810 | defer func() { |
| 811 | <-semaphore |
| 812 | }() |
| 813 | // m.CommandCounter.IncrTotal() |
| 814 | m.CommandCounter.DecrPending() |
| 815 | m.CommandCounter.IncrExecuting() |
| 816 | var totalCountThisServiceThisRegion = 0 |
| 817 | var service = "Lambda Functions" |
| 818 | var resourceNames []string |
| 819 | |
| 820 | ListFunctions, err := sdk.CachedLambdaListFunctions(m.LambdaClient, aws.ToString(m.Caller.Account), r) |
| 821 | if err != nil { |
| 822 | m.modLog.Error(err.Error()) |
| 823 | m.CommandCounter.IncrError() |
| 824 | return |
| 825 | } |
| 826 | |
| 827 | // Add this page of resources to the total count |
| 828 | totalCountThisServiceThisRegion = totalCountThisServiceThisRegion + len(ListFunctions) |
| 829 | |
| 830 | // Add this page of resources to the module's resource list |
| 831 | for _, f := range ListFunctions { |
| 832 | resourceNames = append(resourceNames, aws.ToString(f.FunctionArn)) |
| 833 | } |
| 834 | |
| 835 | m.mu.Lock() |
| 836 | m.resources = append(m.resources, resourceNames...) |
| 837 | m.serviceMap[service][r] = totalCountThisServiceThisRegion |
| 838 | m.totalRegionCounts[r] = m.totalRegionCounts[r] + totalCountThisServiceThisRegion |
| 839 | m.serviceMap["total"][r] = m.serviceMap["total"][r] + totalCountThisServiceThisRegion |
| 840 | m.mu.Unlock() |
| 841 | |
| 842 | } |
| 843 | |
| 844 | func (m *Inventory2Module) getAthenaDatabasesPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) { |
| 845 | defer func() { |
no test coverage detected