File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
src/ServiceControl.Audit/Auditing Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -228,20 +228,17 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
228228 // will only enter here if there is something to read.
229229 try
230230 {
231+ using var batchMetrics = metrics . BeginBatch ( MaxBatchSize ) ;
232+
231233 // as long as there is something to read this will fetch up to MaximumConcurrency items
232- using ( var batchMetrics = metrics . BeginBatch ( MaxBatchSize ) )
234+ while ( channel . Reader . TryRead ( out var context ) )
233235 {
234- while ( channel . Reader . TryRead ( out var context ) )
235- {
236- contexts . Add ( context ) ;
237- }
238-
239- await auditIngestor . Ingest ( contexts ) ;
240-
241- batchMetrics . Complete ( contexts . Count ) ;
236+ contexts . Add ( context ) ;
242237 }
243238
244- //metrics.ClearB .Record(0);
239+ await auditIngestor . Ingest ( contexts ) ;
240+
241+ batchMetrics . Complete ( contexts . Count ) ;
245242 }
246243 catch ( Exception e )
247244 {
@@ -258,9 +255,6 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
258255 }
259256
260257 logger . Info ( "Ingesting messages failed" , e ) ;
261-
262- // no need to do interlocked increment since this is running sequential
263- //consecutiveBatchFailuresCounter.Record(consecutiveBatchFailures++);
264258 }
265259 finally
266260 {
You can’t perform that action at this time.
0 commit comments