10-08
This commit is contained in:
@@ -16,6 +16,32 @@ namespace Project
|
||||
{
|
||||
while(bBW)
|
||||
{
|
||||
if(redisConnection == null)
|
||||
{
|
||||
Console.WriteLine("redis conn : 10.131.36.205:6379");
|
||||
redisConnection = StackExchange.Redis.ConnectionMultiplexer.Connect("10.131.36.205:6379");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (redisConnection.IsConnected)
|
||||
{
|
||||
if(this.db == null)
|
||||
{
|
||||
Console.WriteLine("redis connected setting db");
|
||||
this.db = redisConnection.GetDatabase();
|
||||
var getStr = this.db.StringGet("test");
|
||||
Console.WriteLine(getStr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("resetting redis connection");
|
||||
redisConnection.Dispose();
|
||||
redisConnection = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
System.Threading.Thread.Sleep(5000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user