김민성 수석님. 구매 관련 수정

This commit is contained in:
chi
2019-12-12 16:01:21 +09:00
parent e0dd8f9482
commit d73a2e212a
9 changed files with 161 additions and 179 deletions

View File

@@ -17,49 +17,49 @@ namespace Project
{
while (bBW)
{
if (redisConnection == null)
{
var ts = DateTime.Now - redisTryTime;
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)
{
//if (redisConnection == null)
//{
// var ts = DateTime.Now - redisTryTime;
// 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)
// {
}
}
}
else
{
if (redisConnection.IsConnected)
{
if (this.db == null)
{
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
//{
// if (redisConnection.IsConnected)
// {
// if (this.db == null)
// {
// 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
{
Console.WriteLine("resetting redis connection");
redisConnection.Dispose();
redisConnection = null;
}
}
// }
// }
// else
// {
// Console.WriteLine("resetting redis connection");
// redisConnection.Dispose();
// redisConnection = null;
// }
//}
System.Threading.Thread.Sleep(5000);

View File

@@ -23,13 +23,13 @@ namespace Project
}
else sbBWRun.BackColor = Color.Red;
sbBCD.BackColor = Pub.barcode.IsInit ? Color.Lime : Color.Red;
if (redisConnection == null) this.sbRedis.ForeColor = Color.DimGray;
else if (redisConnection.IsConnected)
{
if (db == null) this.sbRedis.ForeColor = Color.Blue;
else this.sbRedis.ForeColor = Color.Green;
}
else this.sbRedis.ForeColor = Color.Red;
//if (redisConnection == null) this.sbRedis.ForeColor = Color.DimGray;
//else if (redisConnection.IsConnected)
//{
// if (db == null) this.sbRedis.ForeColor = Color.Blue;
// else this.sbRedis.ForeColor = Color.Green;
//}
//else this.sbRedis.ForeColor = Color.Red;
}
}