Skip to content
This repository has been archived by the owner on Dec 24, 2022. It is now read-only.

Commit

Permalink
update pkg refs
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Jan 23, 2022
1 parent 2ed1d89 commit 2320169
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
39 changes: 39 additions & 0 deletions tests/Console.Tests/DbSelectConnectionStringIssue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Threading;
using ServiceStack;
using ServiceStack.Logging;
using ServiceStack.Redis;

namespace ConsoleTests;

class DbSelectConnectionStringIssue
{
public void Execute()
{
LogManager.LogFactory = new ConsoleLogFactory();

Licensing.RegisterLicense("<removed>");

var redisManagerPool = new RedisManagerPool("redis://redisHost?db=7");

for (int i = 0; i < 5; i++)
{
try
{
using (IRedisClient client = redisManagerPool.GetClient())
{
string value = client.GetValue("status");

Console.WriteLine($"Successfully retrieved value => '{value}'");
}
}
catch (Exception ex)
{
Console.WriteLine($"Exception handled \n{ex}");
}

Console.WriteLine("Sleeping for 25 seconds to allow client to be garbage collected");
Thread.Sleep(TimeSpan.FromSeconds(25));
}
}
}
4 changes: 3 additions & 1 deletion tests/Console.Tests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ static void Main(string[] args)

//new BlockingRemoveAfterReconnection().Execute();

new MultiBlockingRemoveAfterReconnection().Execute();
//new MultiBlockingRemoveAfterReconnection().Execute();

new DbSelectConnectionStringIssue().Execute();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net5.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<DebugType>portable</DebugType>
<AssemblyName>ServiceStack.Redis.Tests.Sentinel</AssemblyName>
<OutputType>Library</OutputType>
Expand Down Expand Up @@ -41,12 +41,11 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<DefineConstants>$(DefineConstants);NETCORE_SUPPORT;NETCORE</DefineConstants>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<DefineConstants>$(DefineConstants);NETCORE;NET6_0;NET6_0_OR_GREATER</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.Extensions.Primitives" Version="2.2.0" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.Extensions.Primitives" Version="2.2.0" />
</ItemGroup>
</Project>

0 comments on commit 2320169

Please sign in to comment.