File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44using System ;
55using System . Threading . Tasks ;
6- using Microsoft . Extensions . DependencyInjection ;
76
87namespace DragonFruit . Data . Queues . Jobs
98{
@@ -18,13 +17,5 @@ public abstract class Job
1817 /// Performs the current job as an asynchronous task
1918 /// </summary>
2019 public abstract Task Perform ( IServiceProvider scope ) ;
21-
22- internal async Task PerformInternal ( IServiceScope scope )
23- {
24- using ( scope )
25- {
26- await Perform ( scope . ServiceProvider ) . ConfigureAwait ( false ) ;
27- }
28- }
2920 }
3021}
Original file line number Diff line number Diff line change @@ -198,16 +198,16 @@ protected override async Task ExecuteAsync(CancellationToken cancellation)
198198
199199 if ( ScopeLifetime == ScopeOptions . PerCycle )
200200 {
201- jobTasks . Add ( job . PerformInternal ( jobCycleScope . Value ) ) ;
201+ jobTasks . Add ( job . Perform ( jobCycleScope . Value . ServiceProvider ) ) ;
202202 }
203203 else if ( batchScope != null )
204204 {
205- jobTasks . Add ( job . PerformInternal ( batchScope ) ) ;
205+ jobTasks . Add ( job . Perform ( batchScope . ServiceProvider ) ) ;
206206 }
207207 else
208208 {
209209 var scope = _scopeFactory . CreateScope ( ) ;
210- var jobTask = job . PerformInternal ( scope ) ;
210+ var jobTask = job . Perform ( scope . ServiceProvider ) ;
211211
212212 jobTasks . Add ( jobTask ) ;
213213 jobScopes . Value . Add ( scope ) ;
You can’t perform that action at this time.
0 commit comments