Skip to content

Commit bbdc58e

Browse files
committed
* Allow cancellation of final await for publisher confirmation in BasicPublishAsync
* Fix `dotnet format` verification error
1 parent b0e6142 commit bbdc58e

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

projects/RabbitMQ.Client/Impl/ChannelBase.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,7 @@ await _confirmSemaphore.WaitAsync(cancellationToken)
10701070

10711071
if (publisherConfirmationTcs is not null)
10721072
{
1073-
// TODO timeout?
1074-
await publisherConfirmationTcs.Task
1073+
await publisherConfirmationTcs.Task.WaitAsync(cancellationToken)
10751074
.ConfigureAwait(false);
10761075
}
10771076
}
@@ -1168,8 +1167,7 @@ await _confirmSemaphore.WaitAsync(cancellationToken)
11681167

11691168
if (publisherConfirmationTcs is not null)
11701169
{
1171-
// TODO timeout?
1172-
await publisherConfirmationTcs.Task
1170+
await publisherConfirmationTcs.Task.WaitAsync(cancellationToken)
11731171
.ConfigureAwait(false);
11741172
}
11751173
}

projects/Test/Integration/TestAsyncConsumer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ private async Task ValidateConsumerDispatchConcurrency()
708708
Assert.Equal(ConsumerDispatchConcurrency, autorecoveringChannel.ConsumerDispatcher.Concurrency);
709709
Assert.Equal(_consumerDispatchConcurrency, autorecoveringChannel.ConsumerDispatcher.Concurrency);
710710
await using IChannel ch = await _conn.CreateChannelAsync(
711-
new CreateChannelOptions { ConsumerDispatchConcurrency = expectedConsumerDispatchConcurrency});
711+
new CreateChannelOptions { ConsumerDispatchConcurrency = expectedConsumerDispatchConcurrency });
712712
AutorecoveringChannel ach = (AutorecoveringChannel)ch;
713713
Assert.Equal(expectedConsumerDispatchConcurrency, ach.ConsumerDispatcher.Concurrency);
714714
}

0 commit comments

Comments
 (0)