Skip to content

Commit

Permalink
Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Riku Virtanen committed Sep 12, 2024
1 parent 0852af0 commit 7032abd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Frends.RabbitMQ.Publish/Frends.RabbitMQ.Publish/Publish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private static IConnection GetRabbitMQConnection(Connection connection, Connecti
try
{
var rabbitMQConnection = new RabbitMQConnection { AMQPConnection = factory.CreateConnection() };
RabbitMQConnectionCache.Add($"{Guid.NewGuid()}_{cacheKey}", rabbitMQConnection, new CacheItemPolicy() { RemovedCallback = RemovedCallback, SlidingExpiration = TimeSpan.FromSeconds(connection.ConnectionExpirationSeconds) });
RabbitMQConnectionCache.Add($"{cacheKey}_{Guid.NewGuid()}", rabbitMQConnection, new CacheItemPolicy() { RemovedCallback = RemovedCallback, SlidingExpiration = TimeSpan.FromSeconds(connection.ConnectionExpirationSeconds) });
return rabbitMQConnection.AMQPConnection;
}
catch (Exception ex)
Expand All @@ -248,6 +248,7 @@ private static IConnection GetRabbitMQConnection(Connection connection, Connecti
return null;
}

[ExcludeFromCodeCoverage]
private static string GetCacheKey(Connection connection)
{
var key = $"{connection.Host}:";
Expand Down

0 comments on commit 7032abd

Please sign in to comment.