mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-23 13:41:31 +00:00
Log ping result if it's not PONG
This commit is contained in:
parent
bd41997aae
commit
f1a0d23c99
1 changed files with 10 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
||||||
#nullable enable
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using LBPUnion.ProjectLighthouse.Helpers;
|
using LBPUnion.ProjectLighthouse.Helpers;
|
||||||
|
@ -29,6 +31,13 @@ public static class Redis
|
||||||
|
|
||||||
IRedisConnection connection = getConnection();
|
IRedisConnection connection = getConnection();
|
||||||
|
|
||||||
|
string pong = (await connection.ExecuteAsync("PING")).ToString(CultureInfo.InvariantCulture);
|
||||||
|
if (pong != "PONG")
|
||||||
|
{
|
||||||
|
Logger.LogError("Could not ping, ping returned " + pong, LogArea.Redis);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await connection.CreateIndexAsync(typeof(Room));
|
await connection.CreateIndexAsync(typeof(Room));
|
||||||
await connection.CreateIndexAsync(typeof(UserFriendStore));
|
await connection.CreateIndexAsync(typeof(UserFriendStore));
|
||||||
|
|
||||||
|
@ -38,7 +47,7 @@ public static class Redis
|
||||||
|
|
||||||
private static IRedisConnection getConnection()
|
private static IRedisConnection getConnection()
|
||||||
{
|
{
|
||||||
Logger.LogDebug("Getting a redis connection", LogArea.Redis);
|
Logger.LogDebug("Getting a Redis connection", LogArea.Redis);
|
||||||
return provider.Connection;
|
return provider.Connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue