Skip to content

Commit fbb5652

Browse files
committed
Updated StackExchange.Redis where a bug was solved, causing the Caching example to hang.
1 parent 5194a2a commit fbb5652

File tree

4 files changed

+40
-8
lines changed

4 files changed

+40
-8
lines changed

Solid/PostSharp.Samples.Caching/PostSharp.Samples.Caching.csproj

+15-3
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,32 @@
6666
</ItemGroup>
6767
<ItemGroup>
6868
<PackageReference Include="PostSharp">
69-
<Version>6.4.4</Version>
69+
<Version>6.4.6</Version>
7070
</PackageReference>
7171
<PackageReference Include="PostSharp.Patterns.Caching">
72-
<Version>6.4.4</Version>
72+
<Version>6.4.6</Version>
7373
</PackageReference>
7474
<PackageReference Include="PostSharp.Patterns.Caching.Redis">
75-
<Version>6.4.4</Version>
75+
<Version>6.4.6</Version>
76+
</PackageReference>
77+
<PackageReference Include="PostSharp.Patterns.Diagnostics">
78+
<Version>6.4.6</Version>
7679
</PackageReference>
7780
<PackageReference Include="redis-64">
7881
<Version>3.0.503</Version>
7982
</PackageReference>
83+
<PackageReference Include="StackExchange.Redis">
84+
<Version>2.0.601</Version>
85+
</PackageReference>
86+
<PackageReference Include="System.Buffers">
87+
<Version>4.5.0</Version>
88+
</PackageReference>
8089
<PackageReference Include="System.Collections.Immutable">
8190
<Version>1.7.0</Version>
8291
</PackageReference>
92+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe">
93+
<Version>4.7.0</Version>
94+
</PackageReference>
8395
<PackageReference Include="System.ValueTuple">
8496
<Version>4.5.0</Version>
8597
</PackageReference>

Solid/PostSharp.Samples.Caching/Program.cs

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using PostSharp.Patterns.Caching;
22
using PostSharp.Patterns.Caching.Backends.Redis;
3+
using PostSharp.Patterns.Diagnostics;
4+
using PostSharp.Patterns.Diagnostics.Backends.Console;
35
using StackExchange.Redis;
46
using System;
57
using System.Linq;
@@ -10,12 +12,20 @@ namespace PostSharp.Samples.Caching
1012
internal class Program
1113
{
1214
private static void Main(string[] args)
13-
{
15+
{
16+
17+
AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
18+
LoggingServices.DefaultBackend = new ConsoleLoggingBackend();
19+
20+
// Uncomment the next line for detailed logging.
21+
// LoggingServices.DefaultBackend.DefaultVerbosity.SetMinimalLevel(LogLevel.Debug, LoggingRoles.Caching);
22+
1423
using (RedisServer.Start())
1524
{
1625
using (var connection = ConnectionMultiplexer.Connect("localhost:6380,abortConnect = False"))
1726
{
18-
27+
28+
connection.InternalError += (sender, eventArgs) => Console.Error.WriteLine(eventArgs.Exception);
1929
connection.ErrorMessage += (sender, eventArgs) => Console.Error.WriteLine(eventArgs.Message);
2030
connection.ConnectionFailed += (sender, eventArgs) => Console.Error.WriteLine(eventArgs.Exception);
2131

@@ -62,6 +72,11 @@ private static void Main(string[] args)
6272
}
6373
}
6474
}
65-
}
75+
}
76+
77+
private static void CurrentDomain_FirstChanceException(object sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e)
78+
{
79+
80+
}
6681
}
6782
}

Solid/PostSharp.Samples.Caching/RedisServer.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ public void Dispose()
2727

2828
public static RedisServer Start()
2929
{
30-
if (!Process.GetProcessesByName("redis-server").Any())
30+
if (Process.GetProcessesByName("redis-server").Any())
31+
{
32+
Console.WriteLine("Redis has already started.");
33+
}
34+
else
3135
{
3236
var configFile = Path.GetFullPath("redis.conf");
3337

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
port 6380
22
bind 127.0.0.1
33
maxmemory-policy volatile-lru
4-
notify-keyspace-events AKE
4+
notify-keyspace-events AKE
5+
loglevel verbose

0 commit comments

Comments
 (0)