mirror of
https://gitee.com/iioter/iotgateway.git
synced 2024-11-29 18:28:09 +08:00
fix: 导入配置后报错
This commit is contained in:
parent
f218dfc738
commit
74cb50bf62
@ -101,11 +101,8 @@ namespace IoTGateway.ViewModel.BasicData
|
||||
myMqttClient.StartClientAsync().Wait();
|
||||
|
||||
//重新启动采集
|
||||
foreach (var device in devices.Where(x => x.DeviceTypeEnum == DeviceTypeEnum.Device && x.DriverId != null))
|
||||
{
|
||||
device.Driver = _drivers.FirstOrDefault(x => x.ID == device.DriverId);
|
||||
deviceService.CreateDeviceThread(device);
|
||||
}
|
||||
deviceService.CreateDeviceThreads();
|
||||
|
||||
导入结果 =
|
||||
$"成功导入{devices.Count(x => x.DeviceTypeEnum == DeviceTypeEnum.Device)}个设备,{devices.Count(x => x.DeviceTypeEnum == DeviceTypeEnum.Group)}个组";
|
||||
}
|
||||
|
@ -32,6 +32,12 @@ namespace Plugin
|
||||
_myMqttClient = myMqttClient;
|
||||
//_uAService = uAService;
|
||||
_mqttServer = mqttServer ?? throw new ArgumentNullException(nameof(mqttServer));
|
||||
|
||||
CreateDeviceThreads();
|
||||
}
|
||||
|
||||
public void CreateDeviceThreads()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var dc = new DataContext(_connnectSetting, _dbType))
|
||||
|
Loading…
Reference in New Issue
Block a user