Skip to content

Commit

Permalink
remove some more logging + add null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
hkfgo committed Oct 1, 2024
1 parent 206e155 commit 67bf0a5
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public static class AzureResourceDefinitionBatching
public static List<BatchScrapeDefinition<IAzureResourceDefinition>> GroupScrapeDefinitions(IEnumerable<ScrapeDefinition<IAzureResourceDefinition>> allScrapeDefinitions, int maxBatchSize)
{
Guard.NotNull(allScrapeDefinitions, nameof(allScrapeDefinitions));

Check warning on line 21 in src/Promitor.Core.Scraping/Batching/AzureResourceDefinitionBatching.cs

View workflow job for this annotation

GitHub Actions / Code Quality (R#)

"[PossibleMultipleEnumeration] Possible multiple enumeration" on /home/runner/work/promitor/promitor/src/Promitor.Core.Scraping/Batching/AzureResourceDefinitionBatching.cs(21,1078)
Guard.NotLessThan(allScrapeDefinitions.Count(), 1, nameof(allScrapeDefinitions));

return allScrapeDefinitions.GroupBy(def => def.BuildScrapingBatchInfo())

Check warning on line 23 in src/Promitor.Core.Scraping/Batching/AzureResourceDefinitionBatching.cs

View workflow job for this annotation

GitHub Actions / Code Quality (R#)

"[PossibleMultipleEnumeration] Possible multiple enumeration" on /home/runner/work/promitor/promitor/src/Promitor.Core.Scraping/Batching/AzureResourceDefinitionBatching.cs(23,1152)
.ToDictionary(group => group.Key, group => group.ToList()) // first pass to build batches that could exceed max
Expand All @@ -34,7 +33,6 @@ public static List<BatchScrapeDefinition<IAzureResourceDefinition>> GroupScrapeD
private static List<List<ScrapeDefinition<IAzureResourceDefinition>>> SplitScrapeDefinitionBatch(List<ScrapeDefinition<IAzureResourceDefinition>> batchToSplit, int maxBatchSize)
{
Guard.NotNull(batchToSplit, nameof(batchToSplit));
Guard.NotLessThan(batchToSplit.Count(), 1, nameof(batchToSplit));

int numNewGroups = ((batchToSplit.Count - 1) / maxBatchSize) + 1;

Expand Down

0 comments on commit 67bf0a5

Please sign in to comment.