Skip to content

Commit

Permalink
Use AsyncServiceScope for parallel tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
WillSoss committed Feb 15, 2024
1 parent be5df84 commit 2ae54d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Runly/Processing/ExecutionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ async Task ExecuteParallelTasksAsync()
{
try
{
await ProcessScopeAsync(provider.CreateScope());
using var scope = provider.CreateAsyncScope();
await ProcessScopeAsync(scope);
}
catch (Exception ex) when (Job.Config.Execution.HandleExceptions)
{
Expand All @@ -275,7 +277,7 @@ async Task ExecuteParallelTasksAsync()
/// </summary>
/// <param name="scope">The <see cref="IServiceScope"/> containing a scoped <see cref="IServiceProvider"/> to get services from.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous execution of this method.</returns>
async Task ProcessScopeAsync(IServiceScope scope)
async Task ProcessScopeAsync(AsyncServiceScope scope)
{
bool @continue = true;
var stopwatch = new Stopwatch();
Expand Down

0 comments on commit 2ae54d1

Please sign in to comment.