通过配置实现不上传遥测数据

master
rszn 5 months ago
parent ec9e27714c
commit 0bad7f5ca5

@ -1,5 +1,6 @@
using DotNetty.Transport.Channels; using DotNetty.Transport.Channels;
using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Configuration;
using HybirdFrameworkCore.Redis; using HybirdFrameworkCore.Redis;
using log4net; using log4net;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -26,7 +27,10 @@ namespace Service.Charger.Handler
msg.ChargerNo = sn; msg.ChargerNo = sn;
Log.Info($"receive {msg} from {sn}"); Log.Info($"receive {msg} from {sn}");
RedisHelper.PublishAsync("UploadTelemetryData", JsonConvert.SerializeObject(msg)); if (!AppSettingsConstVars.DisabledTask.Contains("UploadTelemetryData"))
{
RedisHelper.PublishAsync("UploadTelemetryData", JsonConvert.SerializeObject(msg));
}
client.UploadTelemetryData = msg; client.UploadTelemetryData = msg;
//充电机实时充电功率 //充电机实时充电功率

@ -35,5 +35,8 @@
"Job": { "Job": {
"Enabled": false "Enabled": false
}, },
"Task": {
"Disabled": "UploadTelemetryData"
},
"AllowedHosts": "*" "AllowedHosts": "*"
} }

Loading…
Cancel
Save