Skip to content

Commit

Permalink
Update to actually be parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
FirestarJes committed Sep 23, 2024
1 parent f7711b1 commit 62ffd6c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public async Task<string> OrchestrateSettlementReport(
.ThenBy(x => x.PartialFileInfo.ChunkOffset)
.ToList();

foreach (var fileRequest in orderedResults.AsParallel().WithDegreeOfParallelism(5))
await Parallel.ForEachAsync(orderedResults, new ParallelOptions { MaxDegreeOfParallelism = 5 }, async (fileRequest, token) =>
{
var result = await context
.CallActivityAsync<GeneratedSettlementReportFileDto>(
Expand All @@ -75,7 +75,7 @@ public async Task<string> OrchestrateSettlementReport(
{
OrchestrationProgress = (80.0 * generatedFiles.Count / orderedResults.Count) + 10,
});
}
});

var generatedSettlementReport = await context.CallActivityAsync<GeneratedSettlementReportDto>(
nameof(GatherSettlementReportFilesActivity),
Expand Down

0 comments on commit 62ffd6c

Please sign in to comment.