Skip to content

Commit

Permalink
Merge branch 'main' into get-last-results-from-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
tschumpr authored May 2, 2024
2 parents c3f858f + 3e43f31 commit 2f305b6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Geodatenbezug/Geodatenbezug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ public async Task OrchestrateProcessing([OrchestrationTrigger] TaskOrchestration
{
logger.LogInformation("Start der Prozessierung");
var topics = await context.CallActivityAsync<List<Topic>>(nameof(RetrieveTopics)).ConfigureAwait(true);
var results = new List<ProcessingResult>();
var parallelProcessingTasks = new List<Task<ProcessingResult>>();
foreach (var topic in topics)
{
var result = await context.CallActivityAsync<ProcessingResult?>(nameof(ProcessTopic), topic).ConfigureAwait(true);
if (result != null)
{
results.Add(result);
}
parallelProcessingTasks.Add(context.CallActivityAsync<ProcessingResult>(nameof(ProcessTopic), topic));
}

var results = await Task.WhenAll(parallelProcessingTasks).ConfigureAwait(true);
}

/// <summary>
Expand All @@ -54,7 +52,7 @@ public async Task OrchestrateProcessing([OrchestrationTrigger] TaskOrchestration
/// Durable function to process a single topic.
/// </summary>
[Function(nameof(ProcessTopic))]
public async Task<ProcessingResult?> ProcessTopic([ActivityTrigger] Topic topic)
public async Task<ProcessingResult> ProcessTopic([ActivityTrigger] Topic topic)
{
return await processing.ProcessTopic(topic).ConfigureAwait(false);
}
Expand Down

0 comments on commit 2f305b6

Please sign in to comment.