@@ -373,44 +373,44 @@ protected override void StartWorkingImpl(Func<IQueueEntry<T>, CancellationToken,
373373 if ( handler == null )
374374 throw new ArgumentNullException ( nameof ( handler ) ) ;
375375
376- var linkedCancellationToken = GetLinkedDisposableCancellationTokenSource ( cancellationToken ) ;
376+ var linkedCancellationTokenSource = GetLinkedDisposableCancellationTokenSource ( cancellationToken ) ;
377377
378378 Task . Run ( async ( ) =>
379379 {
380380 _logger . LogTrace ( "WorkerLoop Start {QueueName}" , _options . Name ) ;
381381
382- while ( ! linkedCancellationToken . IsCancellationRequested )
382+ while ( ! linkedCancellationTokenSource . IsCancellationRequested )
383383 {
384384 _logger . LogTrace ( "WorkerLoop Signaled {QueueName}" , _options . Name ) ;
385385
386386 IQueueEntry < T > entry = null ;
387387 try
388388 {
389- entry = await DequeueImplAsync ( linkedCancellationToken . Token ) . AnyContext ( ) ;
389+ entry = await DequeueImplAsync ( linkedCancellationTokenSource . Token ) . AnyContext ( ) ;
390390 }
391391 catch ( OperationCanceledException ) { }
392392
393- if ( linkedCancellationToken . IsCancellationRequested || entry == null )
393+ if ( linkedCancellationTokenSource . IsCancellationRequested || entry == null )
394394 continue ;
395395
396396 try
397397 {
398- await handler ( entry , linkedCancellationToken . Token ) . AnyContext ( ) ;
399- if ( autoComplete && ! entry . IsAbandoned && ! entry . IsCompleted && ! linkedCancellationToken . IsCancellationRequested )
398+ await handler ( entry , linkedCancellationTokenSource . Token ) . AnyContext ( ) ;
399+ if ( autoComplete && ! entry . IsAbandoned && ! entry . IsCompleted && ! linkedCancellationTokenSource . IsCancellationRequested )
400400 await entry . CompleteAsync ( ) . AnyContext ( ) ;
401401 }
402402 catch ( Exception ex )
403403 {
404404 Interlocked . Increment ( ref _workerErrorCount ) ;
405405 _logger . LogError ( ex , "Worker error: {Message}" , ex . Message ) ;
406406
407- if ( ! entry . IsAbandoned && ! entry . IsCompleted && ! linkedCancellationToken . IsCancellationRequested )
407+ if ( ! entry . IsAbandoned && ! entry . IsCompleted && ! linkedCancellationTokenSource . IsCancellationRequested )
408408 await entry . AbandonAsync ( ) . AnyContext ( ) ;
409409 }
410410 }
411411
412- _logger . LogTrace ( "Worker exiting: {QueueName} IsCancellationRequested={IsCancellationRequested}" , _options . Name , linkedCancellationToken . IsCancellationRequested ) ;
413- } , linkedCancellationToken . Token ) . ContinueWith ( _ => linkedCancellationToken . Dispose ( ) ) ;
412+ _logger . LogTrace ( "Worker exiting: {QueueName} IsCancellationRequested={IsCancellationRequested}" , _options . Name , linkedCancellationTokenSource . IsCancellationRequested ) ;
413+ } , linkedCancellationTokenSource . Token ) . ContinueWith ( _ => linkedCancellationTokenSource . Dispose ( ) ) ;
414414 }
415415
416416 public override void Dispose ( )
0 commit comments