|
@@ -94,36 +94,36 @@ namespace WCS.Service
|
|
|
//static ConcurrentQueue<PackInfo> Packs = new ConcurrentQueue<PackInfo>();
|
|
|
private static Dictionary<string, Playerback> Clients = new Dictionary<string, Playerback>();
|
|
|
|
|
|
- private static RedisClient Redis;
|
|
|
- public static RedisClient YGWCS150Redis;
|
|
|
+ //private static RedisClient Redis;
|
|
|
+ //public static RedisClient YGWCS150Redis;
|
|
|
public static RedisClient WMS120Redis;
|
|
|
|
|
|
static ProtocolProxy()
|
|
|
{
|
|
|
MessagePackSerializer.DefaultOptions = StandardResolver.Options.WithCompression(MessagePackCompression.Lz4Block);
|
|
|
- Redis = new RedisClient("192.168.249.120,password=123456,database=10");
|
|
|
+ //Redis = new RedisClient("192.168.249.120,password=123456,database=10");
|
|
|
WMS120Redis = new RedisClient("192.168.249.120,password=123456,database=0");
|
|
|
- Redis.Serialize = obj =>
|
|
|
- {
|
|
|
- var bytes = MessagePackSerializer.Serialize(obj);
|
|
|
- return bytes;
|
|
|
- };
|
|
|
- Redis.DeserializeRaw = (bytes, type) =>
|
|
|
- {
|
|
|
- var obj = MessagePackSerializer.Deserialize(type, bytes);
|
|
|
- return obj;
|
|
|
- };
|
|
|
- YGWCS150Redis = new RedisClient("192.168.249.120,password=123456,database=10");
|
|
|
- YGWCS150Redis.Serialize = obj =>
|
|
|
- {
|
|
|
- var bytes = MessagePackSerializer.Serialize(obj);
|
|
|
- return bytes;
|
|
|
- };
|
|
|
- YGWCS150Redis.DeserializeRaw = (bytes, type) =>
|
|
|
- {
|
|
|
- var obj = MessagePackSerializer.Deserialize(type, bytes);
|
|
|
- return obj;
|
|
|
- };
|
|
|
+ //Redis.Serialize = obj =>
|
|
|
+ //{
|
|
|
+ // var bytes = MessagePackSerializer.Serialize(obj);
|
|
|
+ // return bytes;
|
|
|
+ //};
|
|
|
+ //Redis.DeserializeRaw = (bytes, type) =>
|
|
|
+ //{
|
|
|
+ // var obj = MessagePackSerializer.Deserialize(type, bytes);
|
|
|
+ // return obj;
|
|
|
+ //};
|
|
|
+ //YGWCS150Redis = new RedisClient("192.168.249.120,password=123456,database=10");
|
|
|
+ //YGWCS150Redis.Serialize = obj =>
|
|
|
+ //{
|
|
|
+ // var bytes = MessagePackSerializer.Serialize(obj);
|
|
|
+ // return bytes;
|
|
|
+ //};
|
|
|
+ //YGWCS150Redis.DeserializeRaw = (bytes, type) =>
|
|
|
+ //{
|
|
|
+ // var obj = MessagePackSerializer.Deserialize(type, bytes);
|
|
|
+ // return obj;
|
|
|
+ //};
|
|
|
}
|
|
|
|
|
|
//static ConcurrentDictionary<string, DeviceData> Datas = new ConcurrentDictionary<string, DeviceData>();
|
|
@@ -209,27 +209,27 @@ namespace WCS.Service
|
|
|
|
|
|
var sw = new Stopwatch();
|
|
|
sw.Start();
|
|
|
- YGWCS150Redis.Set(nameof(DeviceDataPack), pack);
|
|
|
- Redis.Set(nameof(DeviceDataPack), pack);
|
|
|
- sw.Stop();
|
|
|
- Console.ForegroundColor = ConsoleColor.Blue;
|
|
|
- Console.WriteLine($"Redis耗时{sw.ElapsedMilliseconds}");
|
|
|
- Console.ResetColor();
|
|
|
+ //YGWCS150Redis.Set(nameof(DeviceDataPack), pack);
|
|
|
+ //Redis.Set(nameof(DeviceDataPack), pack);
|
|
|
+ //sw.Stop();
|
|
|
+ //Console.ForegroundColor = ConsoleColor.Blue;
|
|
|
+ //Console.WriteLine($"Redis耗时{sw.ElapsedMilliseconds}");
|
|
|
+ //Console.ResetColor();
|
|
|
|
|
|
- YGWCS150Redis.RPush("Packs", pack);
|
|
|
- Redis.RPush("Packs", pack);
|
|
|
+ //YGWCS150Redis.RPush("Packs", pack);
|
|
|
+ //Redis.RPush("Packs", pack);
|
|
|
|
|
|
- var len1 = YGWCS150Redis.LLen("Packs");
|
|
|
- var len = Redis.LLen("Packs");
|
|
|
+ //var len1 = YGWCS150Redis.LLen("Packs");
|
|
|
+ //var len = Redis.LLen("Packs");
|
|
|
|
|
|
- if (len1 > 150000)
|
|
|
- {
|
|
|
- YGWCS150Redis.LTrim("Packs", 20000, len);
|
|
|
- }
|
|
|
- if (len > 150000)
|
|
|
- {
|
|
|
- Redis.LTrim("Packs", 20000, len);
|
|
|
- }
|
|
|
+ //if (len1 > 150000)
|
|
|
+ //{
|
|
|
+ // YGWCS150Redis.LTrim("Packs", 20000, len);
|
|
|
+ //}
|
|
|
+ //if (len > 150000)
|
|
|
+ //{
|
|
|
+ // Redis.LTrim("Packs", 20000, len);
|
|
|
+ //}
|
|
|
|
|
|
foreach (var data in AllDatas)
|
|
|
{
|