Skip to content

Commit 2ae54d1

Browse files
committed
Use AsyncServiceScope for parallel tasks
1 parent be5df84 commit 2ae54d1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Runly/Processing/ExecutionBase.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ async Task ExecuteParallelTasksAsync()
256256
{
257257
try
258258
{
259-
await ProcessScopeAsync(provider.CreateScope());
259+
using var scope = provider.CreateAsyncScope();
260+
261+
await ProcessScopeAsync(scope);
260262
}
261263
catch (Exception ex) when (Job.Config.Execution.HandleExceptions)
262264
{
@@ -275,7 +277,7 @@ async Task ExecuteParallelTasksAsync()
275277
/// </summary>
276278
/// <param name="scope">The <see cref="IServiceScope"/> containing a scoped <see cref="IServiceProvider"/> to get services from.</param>
277279
/// <returns>A <see cref="Task"/> representing the asynchronous execution of this method.</returns>
278-
async Task ProcessScopeAsync(IServiceScope scope)
280+
async Task ProcessScopeAsync(AsyncServiceScope scope)
279281
{
280282
bool @continue = true;
281283
var stopwatch = new Stopwatch();

0 commit comments

Comments
 (0)