Revert "fixed rabbitmq connection leak"

This reverts commit 633ed22763.
This commit is contained in:
Alexey Bannov 2023-08-08 13:40:04 +03:00
parent 0952050f8a
commit c5d4272685

View File

@ -68,13 +68,8 @@ public class DefaultRabbitMQPersistentConnection
return;
}
_disposed = true;
DisposeConnection();
}
private void DisposeConnection()
{
_disposed = true;
try
{
_connection.ConnectionShutdown -= OnConnectionShutdown;
@ -85,8 +80,8 @@ public class DefaultRabbitMQPersistentConnection
catch (IOException ex)
{
_logger.CriticalDefaultRabbitMQPersistentConnection(ex);
}
}
}
}
public bool TryConnect()
{
@ -103,12 +98,7 @@ public class DefaultRabbitMQPersistentConnection
);
policy.Execute(() =>
{
if (_connection != null)
{
DisposeConnection();
}
{
_connection = _connectionFactory
.CreateConnection();
});