Skip to content

Commit cb714e0

Browse files
Add a cancellation token to the WaitAsync method
1 parent 844553a commit cb714e0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/NServiceBus.Transport.Sql.Shared/Receiving/AsyncCountdownLatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public AsyncCountdownLatch(int count)
1919
}
2020
}
2121

22-
public Task WaitAsync() => completionSource.Task;
22+
public Task WaitAsync(CancellationToken cancellationToken = default) => completionSource.Task;
2323

2424
public void Signal()
2525
{

src/NServiceBus.Transport.Sql.Shared/Receiving/MessageReceiver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ async Task ReceiveMessages(CancellationToken messageReceivingCancellationToken)
225225
if (shouldWaitForReceiveTasks)
226226
{
227227
// Wait for all receive operations to complete before returning (and thus peeking again)
228-
await receiveLatch.WaitAsync().ConfigureAwait(false);
228+
await receiveLatch.WaitAsync(CancellationToken.None).ConfigureAwait(false);
229229
}
230230
}
231231

0 commit comments

Comments
 (0)