Skip to content

Commit b03b485

Browse files
committed
fixed 'dotnet.exe' process incomplete quit when shutdown application. ( #64 )
1 parent 0c73f8d commit b03b485

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ internal sealed class RabbitMQConsumerClient : IConsumerClient
1414
private readonly string _queueName;
1515
private readonly RabbitMQOptions _rabbitMQOptions;
1616

17+
private IConnection _connection;
1718
private IModel _channel;
1819
private ulong _deliveryTag;
1920

@@ -57,6 +58,7 @@ public void Listening(TimeSpan timeout, CancellationToken cancellationToken)
5758
cancellationToken.ThrowIfCancellationRequested();
5859
cancellationToken.WaitHandle.WaitOne(timeout);
5960
}
61+
// ReSharper disable once FunctionNeverReturns
6062
}
6163

6264
public void Commit()
@@ -72,11 +74,12 @@ public void Reject()
7274
public void Dispose()
7375
{
7476
_channel.Dispose();
77+
_connection.Dispose();
7578
}
7679

7780
private void InitClient()
7881
{
79-
var _connection = _connectionChannelPool.GetConnection();
82+
_connection = _connectionChannelPool.GetConnection();
8083

8184
_channel = _connection.CreateModel();
8285

0 commit comments

Comments
 (0)