smt 로그 기능 별도 프로젝트로 분리

This commit is contained in:
chikyun.kim
2019-10-02 11:21:14 +09:00
parent 80d00fd4b6
commit c9cda6251c
32 changed files with 33 additions and 7156 deletions

View File

@@ -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);
}