并行启动采集线程

This commit is contained in:
iioter 2023-10-21 22:13:01 +08:00
parent e9ee682f37
commit 68f217fa3f

View File

@ -40,10 +40,7 @@ namespace Plugin
.Include(x => x.Parent).Include(x => x.Driver).Include(x => x.DeviceConfigs)
.Include(x => x.DeviceVariables).AsNoTracking().ToList();
_logger.LogInformation($"Loaded Devices Count:{devices.Count()}");
foreach (var device in devices)
{
CreateDeviceThread(device);
}
Parallel.ForEach(devices, CreateDeviceThread);
}
}
catch (Exception ex)