Skip to content

Commit f9dbe3e

Browse files
committed
* Finish up TODOs
1 parent 8b26520 commit f9dbe3e

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

projects/RabbitMQ.Client/client/impl/AutorecoveringConnection.Recovery.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ await ch.CloseAsync(cancellationToken)
286286
try
287287
{
288288
_recordedEntitiesSemaphore.Release();
289-
// TODO maybe cancellation token
289+
// FUTURE (?) cancellation token
290290
await _config.TopologyRecoveryExceptionHandler.ExchangeRecoveryExceptionHandlerAsync(recordedExchange, ex, this)
291291
.ConfigureAwait(false);
292292
}
@@ -375,7 +375,7 @@ await _recordedEntitiesSemaphore.WaitAsync(cancellationToken)
375375
try
376376
{
377377
_recordedEntitiesSemaphore.Release();
378-
// TODO maybe cancellation token
378+
// FUTURE (?) cancellation token
379379
await _config.TopologyRecoveryExceptionHandler.QueueRecoveryExceptionHandlerAsync(recordedQueue, ex, this)
380380
.ConfigureAwait(false);
381381
}
@@ -449,7 +449,7 @@ await ch.CloseAsync(cancellationToken)
449449
try
450450
{
451451
_recordedEntitiesSemaphore.Release();
452-
// TODO maybe cancellation token
452+
// FUTURE (?) cancellation token
453453
await _config.TopologyRecoveryExceptionHandler.BindingRecoveryExceptionHandlerAsync(binding, ex, this)
454454
.ConfigureAwait(false);
455455
}

projects/RabbitMQ.Client/client/impl/ChannelBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ await ModelSendAsync(method, k.CancellationToken)
242242
bool result = await k;
243243
Debug.Assert(result);
244244

245-
// TODO cancellation token
246245
await ConsumerDispatcher.WaitForShutdownAsync()
247246
.ConfigureAwait(false);
248247
}

projects/RabbitMQ.Client/client/impl/Connection.Commands.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,13 @@ private void MaybeStartCredentialRefresher()
199199
}
200200
}
201201

202-
private Task NotifyCredentialRefreshed(bool succesfully)
202+
private async Task NotifyCredentialRefreshed(bool succesfully)
203203
{
204204
if (succesfully)
205205
{
206-
return UpdateSecretAsync(_config.CredentialsProvider.Password, "Token refresh",
207-
CancellationToken.None); // TODO cancellation token
208-
}
209-
else
210-
{
211-
return Task.CompletedTask;
206+
using var cts = new CancellationTokenSource(InternalConstants.DefaultConnectionCloseTimeout);
207+
await UpdateSecretAsync(_config.CredentialsProvider.Password, "Token refresh", cts.Token)
208+
.ConfigureAwait(false);
212209
}
213210
}
214211

0 commit comments

Comments
 (0)