redis 버그 수정

This commit is contained in:
김판돌 2024-04-06 20:18:26 +09:00
parent 72c491b216
commit 2a04631b5e
2 changed files with 20 additions and 5 deletions

View File

@ -15,7 +15,7 @@ namespace Server.System
Dictionary<string, List<string>> listType;
Dictionary<string, List<Rank>> zType;
Dictionary<string, Dictionary<string, string>> hashType;
public Redis(string host = "127.0.0.1", int port = 6379, int db = 0)
public Redis(string host = "127.0.0.1", int port = 6379, int db = 0, string password = "")
{
if (host == "localhost")
{
@ -27,8 +27,23 @@ namespace Server.System
}
else
{
redis = ConnectionMultiplexer.Connect($"{host}:{port}");
this.db = redis.GetDatabase(db);
if (password.Equals(string.Empty))
{
Console.WriteLine("true");
redis = ConnectionMultiplexer.Connect($"{host}:{port}");
this.db = redis.GetDatabase(db);
}
else
{
Console.WriteLine("true");
ConfigurationOptions options = new ConfigurationOptions
{
EndPoints = { $"{host}:{port}" },
Password = password
};
redis = ConnectionMultiplexer.Connect(options);
this.db = redis.GetDatabase(db);
}
}
}

View File

@ -10,12 +10,12 @@ namespace Server.System
public static readonly string SQL_URL = "Host=192.168.0.2;Port=5432;Username=manager;Password=Zn2zs558W5SdD8K;Database=project_thewar;";
public static readonly string EXCEL_SQL_URL = "Host=192.168.0.2;Port=5432;Username=manager;Password=Zn2zs558W5SdD8K;Database=project_thewar;";
public static readonly string remoteUrl = "https://manager:BQNl01bJJF0wn9R@gitea.pandoli365.com/Team.thewar/thewar_excel.git";
public static readonly Redis redis = new Redis("192.168.1.2", 6379, 1);
public static readonly Redis redis = new Redis("192.168.1.2", 6379, 1, "xPEz3x08xQ8G1Fa");
#elif LIVE
public static readonly string SQL_URL = "Host=192.168.0.2;Port=5432;Username=manager;Password=Zn2zs558W5SdD8K;Database=project_thewar;";
public static readonly string EXCEL_SQL_URL = "Host=192.168.0.2;Port=5432;Username=manager;Password=Zn2zs558W5SdD8K;Database=project_thewar;";
public static readonly string remoteUrl = "https://manager:BQNl01bJJF0wn9R@gitea.pandoli365.com/Team.thewar/thewar_excel_live.git";
public static readonly Redis redis = new Redis("192.168.1.2", 6379, 1);
public static readonly Redis redis = new Redis("192.168.1.2", 6379, 1, "xPEz3x08xQ8G1Fa");
#endif
public static readonly string URL = "https://0.0.0.0:4860";