@@ -179,8 +179,7 @@ await RecoverExchangesAsync(_innerConnection, recordedEntitiesSemaphoreHeld: tru
179
179
. ConfigureAwait ( false ) ;
180
180
await RecoverQueuesAsync ( _innerConnection , recordedEntitiesSemaphoreHeld : true , cancellationToken )
181
181
. ConfigureAwait ( false ) ;
182
- // TODO cancellation token
183
- await RecoverBindingsAsync ( _innerConnection , recordedEntitiesSemaphoreHeld : true )
182
+ await RecoverBindingsAsync ( _innerConnection , recordedEntitiesSemaphoreHeld : true , cancellationToken )
184
183
. ConfigureAwait ( false ) ;
185
184
186
185
}
@@ -418,7 +417,7 @@ void UpdateConsumerQueue(string oldName, string newName)
418
417
}
419
418
420
419
private async ValueTask RecoverBindingsAsync ( IConnection connection ,
421
- bool recordedEntitiesSemaphoreHeld = false )
420
+ bool recordedEntitiesSemaphoreHeld , CancellationToken cancellationToken )
422
421
{
423
422
if ( _disposed )
424
423
{
@@ -434,11 +433,11 @@ private async ValueTask RecoverBindingsAsync(IConnection connection,
434
433
{
435
434
try
436
435
{
437
- using ( IChannel ch = await connection . CreateChannelAsync ( ) . ConfigureAwait ( false ) )
436
+ using ( IChannel ch = await connection . CreateChannelAsync ( cancellationToken ) . ConfigureAwait ( false ) )
438
437
{
439
- await binding . RecoverAsync ( ch )
438
+ await binding . RecoverAsync ( ch , cancellationToken )
440
439
. ConfigureAwait ( false ) ;
441
- await ch . CloseAsync ( )
440
+ await ch . CloseAsync ( cancellationToken )
442
441
. ConfigureAwait ( false ) ;
443
442
}
444
443
}
@@ -450,12 +449,13 @@ await ch.CloseAsync()
450
449
try
451
450
{
452
451
_recordedEntitiesSemaphore . Release ( ) ;
452
+ // TODO maybe cancellation token
453
453
await _config . TopologyRecoveryExceptionHandler . BindingRecoveryExceptionHandlerAsync ( binding , ex , this )
454
454
. ConfigureAwait ( false ) ;
455
455
}
456
456
finally
457
457
{
458
- await _recordedEntitiesSemaphore . WaitAsync ( )
458
+ await _recordedEntitiesSemaphore . WaitAsync ( cancellationToken )
459
459
. ConfigureAwait ( false ) ;
460
460
}
461
461
}
0 commit comments