Skip to content

Commit 5e93c90

Browse files
committed
Add clarifying code comment on why a CancellationToken is passed in the cancelled state
1 parent 011ed4e commit 5e93c90

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/ServiceControl.Audit/Auditing/AuditIngestion.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ async Task EnsureStopped(CancellationToken cancellationToken)
185185
try
186186
{
187187
await startStopSemaphore.WaitAsync(cancellationToken);
188+
189+
// By passing a CancellationToken in the cancelled state we stop receivers ASAP and
190+
// still correctly stop/shutdown
188191
await StopAndTeardownInfrastructure(new CancellationToken(canceled: true));
189192
}
190193
finally

src/ServiceControl/Operations/ErrorIngestion.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ async Task EnsureStopped(CancellationToken cancellationToken = default)
293293
try
294294
{
295295
await startStopSemaphore.WaitAsync(cancellationToken);
296+
297+
// By passing a CancellationToken in the cancelled state we stop receivers ASAP and
298+
// still correctly stop/shutdown
296299
await StopAndTeardownInfrastructure(new CancellationToken(canceled: true));
297300
}
298301
finally

0 commit comments

Comments
 (0)