This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +46
-7
lines changed
ServiceStack.Redis.Tests.Sentinel Expand file tree Collapse file tree 4 files changed +46
-7
lines changed Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Threading ;
3+ using ServiceStack ;
4+ using ServiceStack . Logging ;
5+ using ServiceStack . Redis ;
6+
7+ namespace ConsoleTests ;
8+
9+ class DbSelectConnectionStringIssue
10+ {
11+ public void Execute ( )
12+ {
13+ LogManager . LogFactory = new ConsoleLogFactory ( ) ;
14+
15+ Licensing . RegisterLicense ( "<removed>" ) ;
16+
17+ var redisManagerPool = new RedisManagerPool ( "redis://redisHost?db=7" ) ;
18+
19+ for ( int i = 0 ; i < 5 ; i ++ )
20+ {
21+ try
22+ {
23+ using ( IRedisClient client = redisManagerPool . GetClient ( ) )
24+ {
25+ string value = client . GetValue ( "status" ) ;
26+
27+ Console . WriteLine ( $ "Successfully retrieved value => '{ value } '") ;
28+ }
29+ }
30+ catch ( Exception ex )
31+ {
32+ Console . WriteLine ( $ "Exception handled \n { ex } ") ;
33+ }
34+
35+ Console . WriteLine ( "Sleeping for 25 seconds to allow client to be garbage collected" ) ;
36+ Thread . Sleep ( TimeSpan . FromSeconds ( 25 ) ) ;
37+ }
38+ }
39+ }
Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ static void Main(string[] args)
4040
4141 //new BlockingRemoveAfterReconnection().Execute();
4242
43- new MultiBlockingRemoveAfterReconnection ( ) . Execute ( ) ;
43+ //new MultiBlockingRemoveAfterReconnection().Execute();
44+
45+ new DbSelectConnectionStringIssue ( ) . Execute ( ) ;
4446 }
4547 }
4648}
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFrameworks >net472;net5 .0</TargetFrameworks >
4+ <TargetFrameworks >net472;net6 .0</TargetFrameworks >
55 <DebugType >portable</DebugType >
66 <AssemblyName >ServiceStack.Redis.Tests.Sentinel</AssemblyName >
77 <OutputType >Library</OutputType >
4141 <Reference Include =" Microsoft.CSharp" />
4242 </ItemGroup >
4343
44- <PropertyGroup Condition =" '$(TargetFramework)' == 'net5 .0' " >
45- <DefineConstants >$(DefineConstants);NETCORE_SUPPORT; NETCORE</DefineConstants >
44+ <PropertyGroup Condition =" '$(TargetFramework)' == 'net6 .0' " >
45+ <DefineConstants >$(DefineConstants);NETCORE;NET6_0;NET6_0_OR_GREATER </DefineConstants >
4646 </PropertyGroup >
4747
48- <ItemGroup Condition =" '$(TargetFramework)' == 'net5.0' " >
49- <PackageReference Include =" Microsoft.Extensions.Primitives" Version =" 2.2.0" />
48+ <ItemGroup Condition =" '$(TargetFramework)' == 'net6.0' " >
5049 </ItemGroup >
5150
5251</Project >
Original file line number Diff line number Diff line change 5050 <Reference Include =" Microsoft.CSharp" />
5151 </ItemGroup >
5252 <ItemGroup Condition =" '$(TargetFramework)' == 'net6.0' " >
53- <PackageReference Include =" Microsoft.Extensions.Primitives" Version =" 2.2.0" />
5453 </ItemGroup >
5554</Project >
You can’t perform that action at this time.
0 commit comments