diff --git a/Geodatenbezug/Geodatenbezug.cs b/Geodatenbezug/Geodatenbezug.cs index 3837fbd..d41bc14 100644 --- a/Geodatenbezug/Geodatenbezug.cs +++ b/Geodatenbezug/Geodatenbezug.cs @@ -27,15 +27,13 @@ public async Task OrchestrateProcessing([OrchestrationTrigger] TaskOrchestration { logger.LogInformation("Start der Prozessierung"); var topics = await context.CallActivityAsync>(nameof(RetrieveTopics)).ConfigureAwait(true); - var results = new List(); + var parallelProcessingTasks = new List>(); foreach (var topic in topics) { - var result = await context.CallActivityAsync(nameof(ProcessTopic), topic).ConfigureAwait(true); - if (result != null) - { - results.Add(result); - } + parallelProcessingTasks.Add(context.CallActivityAsync(nameof(ProcessTopic), topic)); } + + var results = await Task.WhenAll(parallelProcessingTasks).ConfigureAwait(true); } /// @@ -54,7 +52,7 @@ public async Task OrchestrateProcessing([OrchestrationTrigger] TaskOrchestration /// Durable function to process a single topic. /// [Function(nameof(ProcessTopic))] - public async Task ProcessTopic([ActivityTrigger] Topic topic) + public async Task ProcessTopic([ActivityTrigger] Topic topic) { return await processing.ProcessTopic(topic).ConfigureAwait(false); }