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)
40
40
41
41
//new BlockingRemoveAfterReconnection().Execute();
42
42
43
- new MultiBlockingRemoveAfterReconnection ( ) . Execute ( ) ;
43
+ //new MultiBlockingRemoveAfterReconnection().Execute();
44
+
45
+ new DbSelectConnectionStringIssue ( ) . Execute ( ) ;
44
46
}
45
47
}
46
48
}
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
3
3
<PropertyGroup >
4
- <TargetFrameworks >net472;net5 .0</TargetFrameworks >
4
+ <TargetFrameworks >net472;net6 .0</TargetFrameworks >
5
5
<DebugType >portable</DebugType >
6
6
<AssemblyName >ServiceStack.Redis.Tests.Sentinel</AssemblyName >
7
7
<OutputType >Library</OutputType >
41
41
<Reference Include =" Microsoft.CSharp" />
42
42
</ItemGroup >
43
43
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 >
46
46
</PropertyGroup >
47
47
48
- <ItemGroup Condition =" '$(TargetFramework)' == 'net5.0' " >
49
- <PackageReference Include =" Microsoft.Extensions.Primitives" Version =" 2.2.0" />
48
+ <ItemGroup Condition =" '$(TargetFramework)' == 'net6.0' " >
50
49
</ItemGroup >
51
50
52
51
</Project >
Original file line number Diff line number Diff line change 50
50
<Reference Include =" Microsoft.CSharp" />
51
51
</ItemGroup >
52
52
<ItemGroup Condition =" '$(TargetFramework)' == 'net6.0' " >
53
- <PackageReference Include =" Microsoft.Extensions.Primitives" Version =" 2.2.0" />
54
53
</ItemGroup >
55
54
</Project >
You can’t perform that action at this time.
0 commit comments