File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/ProductConstructionService/ProductConstructionService.WorkItems Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,18 @@ protected override async Task ExecuteAsync(CancellationToken cancellationToken)
4343
4444 while ( ! cancellationToken . IsCancellationRequested )
4545 {
46- await using ( WorkItemScope workItemScope = await _scopeManager . BeginWorkItemScopeWhenReadyAsync ( ) )
46+ WorkItemScope workItemScope ;
47+ try
48+ {
49+ workItemScope = await _scopeManager . BeginWorkItemScopeWhenReadyAsync ( ) ;
50+ }
51+ catch ( Exception ex )
52+ {
53+ _logger . LogCritical ( ex , "Consumer {consumerId} failed to begin work item scope" , _consumerId ) ;
54+ throw ;
55+ }
56+
57+ await using ( workItemScope )
4758 {
4859 if ( cancellationToken . IsCancellationRequested )
4960 {
@@ -64,6 +75,8 @@ protected override async Task ExecuteAsync(CancellationToken cancellationToken)
6475 }
6576 }
6677 }
78+
79+ _logger . LogInformation ( "Consumer {consumerId} stopping processing PCS queue {queueName}" , _consumerId , _queueName ) ;
6780 }
6881
6982 private async Task ReadAndProcessWorkItemAsync ( QueueClient queueClient , WorkItemScope workItemScope , CancellationToken cancellationToken )
You can’t perform that action at this time.
0 commit comments