Skip to content

Commit

Permalink
not cached connection errors (imperugo#296)
Browse files Browse the repository at this point in the history
Co-authored-by: Anton Dimkov <anton.dimkov@ubisoft.com>
  • Loading branch information
adimkov and Anton Dimkov authored Jul 12, 2020
1 parent 0d24a61 commit 3b96265
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Threading;

using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
Expand Down Expand Up @@ -101,7 +102,8 @@ public ConnectionPoolInformation GetConnectionInformations()

private void EmitConnection()
{
this.connections.Add(new Lazy<StateAwareConnection>(() =>
this.connections.Add(new Lazy<StateAwareConnection>(
() =>
{
this.logger.LogDebug("Creating new Redis connection.");
Expand All @@ -114,7 +116,8 @@ private void EmitConnection()
multiplexer = multiplexer.GetSentinelMasterConnection(redisConfiguration.ConfigurationOptions);
return new StateAwareConnection(multiplexer, this.EmitConnection, logger);
}));
},
LazyThreadSafetyMode.PublicationOnly));
}

private void EmitConnections()
Expand Down

0 comments on commit 3b96265

Please sign in to comment.