Skip to content

Commit

Permalink
Updated packages and bugfixing on connection pool
Browse files Browse the repository at this point in the history
  • Loading branch information
imperugo committed Apr 9, 2020
1 parent 9c5a2bf commit dddd40b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,23 @@ namespace StackExchange.Redis.Samples.Web.Mvc.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly ILogger<HomeController> logger;
private readonly IRedisDatabase redisDatabase;
private readonly IRedisCacheConnectionPoolManager connectionPoolManager;

public HomeController(ILogger<HomeController> logger, IRedisDatabase redisDatabase)
public HomeController(ILogger<HomeController> logger, IRedisDatabase redisDatabase, IRedisCacheConnectionPoolManager connectionPoolManager)
{
_logger = logger;
this.logger = logger;
this.redisDatabase = redisDatabase;
this.connectionPoolManager = connectionPoolManager;
}


public async Task<IActionResult> Index()
{
var redisInfo = await redisDatabase.GetInfoAsync();
return Ok(redisInfo);
}

public IActionResult Privacy()
{
return View();
}

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
var connectionInfo = connectionPoolManager.GetConnectionInformations();
return Ok(new { RedisInfo = redisInfo, ConnectionInfo = connectionInfo });
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.1.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public IConnectionMultiplexer GetConnection()
{
this.EmitConnections();

var loadedLazies = this.connections.Where(lazy => lazy.IsValueCreated);
var loadedLazies = this.connections.Where(lazy => lazy.IsValueCreated && lazy.Value.IsValid() && lazy.Value.IsConnected());

if (loadedLazies.Count() == this.connections.Count)
return (ConnectionMultiplexer)this.connections.OrderBy(x => x.Value.TotalOutstanding()).First().Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="StackExchange.Redis" Version="2.0.519" />
<PackageReference Include="StackExchange.Redis" Version="2.1.30" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.3" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="protobuf-net" Version="2.4.4" />
<PackageReference Include="protobuf-net" Version="2.4.6" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion targets/Targets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bullseye" Version="3.2.0" />
<PackageReference Include="Bullseye" Version="3.3.0" />
<PackageReference Include="Colorful.Console" Version="1.2.10" />
<PackageReference Include="SimpleExec" Version="6.2.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="coverlet.collector" Version="1.2.0">
<PackageReference Include="coverlet.collector" Version="1.2.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit dddd40b

Please sign in to comment.