Skip to content

Commit

Permalink
added connection failed logic to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabefire committed Jun 10, 2024
1 parent 7512a0d commit 59748d9
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions TalkWaveApi.WebSocket/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,27 @@
hubOptions.HandshakeTimeout = TimeSpan.FromSeconds(5);
}).AddStackExchangeRedis(RedisConnection, options =>
{
options.Configuration.Ssl = true;
options.Configuration.AbortOnConnectFail = false;
options.ConnectionFactory = async writer =>
{
var config = new ConfigurationOptions
{
AbortOnConnectFail = false,
Ssl = true
};
var connection = await ConnectionMultiplexer.ConnectAsync(config, writer);
connection.ConnectionFailed += (_, e) =>
{
Console.WriteLine(e.Exception?.ToString());
Console.WriteLine("Connection to Redis failed.");
};
if (!connection.IsConnected)
{
Console.WriteLine("Did not connect to Redis.");
}
return connection;
};
});
}
else
Expand Down

0 comments on commit 59748d9

Please sign in to comment.