File tree Expand file tree Collapse file tree 2 files changed +59
-187
lines changed
projects/RabbitMQ.Client/Impl Expand file tree Collapse file tree 2 files changed +59
-187
lines changed Original file line number Diff line number Diff line change @@ -131,38 +131,27 @@ private async Task MaybeConfirmSelect(CancellationToken cancellationToken)
131
131
if ( _publisherConfirmationsEnabled )
132
132
{
133
133
// NOTE: _rpcSemaphore is held
134
- bool enqueued = false ;
135
- var k = new ConfirmSelectAsyncRpcContinuation ( ContinuationTimeout , cancellationToken ) ;
134
+ using var k = new ConfirmSelectAsyncRpcContinuation ( ContinuationTimeout , cancellationToken ) ;
136
135
137
- try
136
+ if ( _nextPublishSeqNo == 0UL )
138
137
{
139
- if ( _nextPublishSeqNo == 0UL )
138
+ if ( _publisherConfirmationTrackingEnabled )
140
139
{
141
- if ( _publisherConfirmationTrackingEnabled )
142
- {
143
- _confirmsTaskCompletionSources . Clear ( ) ;
144
- }
145
- _nextPublishSeqNo = 1 ;
140
+ _confirmsTaskCompletionSources . Clear ( ) ;
146
141
}
142
+ _nextPublishSeqNo = 1 ;
143
+ }
147
144
148
- enqueued = Enqueue ( k ) ;
145
+ Enqueue ( k ) ;
149
146
150
- var method = new ConfirmSelect ( false ) ;
151
- await ModelSendAsync ( in method , k . CancellationToken )
152
- . ConfigureAwait ( false ) ;
147
+ var method = new ConfirmSelect ( false ) ;
148
+ await ModelSendAsync ( in method , k . CancellationToken )
149
+ . ConfigureAwait ( false ) ;
153
150
154
- bool result = await k ;
155
- Debug . Assert ( result ) ;
151
+ bool result = await k ;
152
+ Debug . Assert ( result ) ;
156
153
157
- return ;
158
- }
159
- finally
160
- {
161
- if ( false == enqueued )
162
- {
163
- k . Dispose ( ) ;
164
- }
165
- }
154
+ return ;
166
155
}
167
156
}
168
157
You can’t perform that action at this time.
0 commit comments