Skip to content

Commit 9426ea9

Browse files
committed
Skip interlocked increment
1 parent fa5e658 commit 9426ea9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ServiceControl.Audit/Auditing/AuditIngestion.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ async Task Loop()
222222
await auditIngestor.Ingest(contexts);
223223
}
224224

225-
consecutiveBatchFailuresCounter.Record(Interlocked.Exchange(ref consecutiveBatchFailures, 0));
225+
consecutiveBatchFailuresCounter.Record(0);
226226
}
227227
catch (OperationCanceledException)
228228
{
@@ -242,7 +242,8 @@ async Task Loop()
242242
context.GetTaskCompletionSource().TrySetException(e);
243243
}
244244

245-
consecutiveBatchFailuresCounter.Record(Interlocked.Increment(ref consecutiveBatchFailures));
245+
// no need to do interlocked increment since this is running sequential
246+
consecutiveBatchFailuresCounter.Record(consecutiveBatchFailures++);
246247
}
247248
finally
248249
{

0 commit comments

Comments
 (0)