smt 로그 기능 별도 프로젝트로 분리
This commit is contained in:
@@ -15,18 +15,19 @@ namespace Project
|
||||
Boolean bBW = true;
|
||||
private void bw_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
while(bBW)
|
||||
while (bBW)
|
||||
{
|
||||
if(redisConnection == null)
|
||||
if (redisConnection == null)
|
||||
{
|
||||
var ts = DateTime.Now - redisTryTime;
|
||||
if(ts.TotalMinutes>5)
|
||||
if (ts.TotalMinutes > 5)
|
||||
{
|
||||
Console.WriteLine("redis conn : 10.131.36.57:6379");
|
||||
try
|
||||
{
|
||||
redisConnection = StackExchange.Redis.ConnectionMultiplexer.Connect("10.131.36.57:6379");
|
||||
}catch (Exception ex)
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -36,12 +37,20 @@ namespace Project
|
||||
{
|
||||
if (redisConnection.IsConnected)
|
||||
{
|
||||
if(this.db == null)
|
||||
if (this.db == null)
|
||||
{
|
||||
Console.WriteLine("redis connected setting db");
|
||||
this.db = redisConnection.GetDatabase();
|
||||
var getStr = this.db.StringGet("test");
|
||||
Console.WriteLine(getStr);
|
||||
try
|
||||
{
|
||||
Console.WriteLine("redis connected setting db");
|
||||
this.db = redisConnection.GetDatabase();
|
||||
var getStr = this.db.StringGet("test");
|
||||
Console.WriteLine(getStr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Pub.log.AddE("REDIS " + ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -51,7 +60,7 @@ namespace Project
|
||||
redisConnection = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
System.Threading.Thread.Sleep(5000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user