fix: device and driver

This commit is contained in:
iioter 2024-05-28 09:03:30 +08:00
parent dfb56687d7
commit 3e42f072e5
2 changed files with 6 additions and 3 deletions

View File

@ -40,7 +40,10 @@ 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()}");
Parallel.ForEach(devices, CreateDeviceThread);
foreach (var device in devices)
{
CreateDeviceThread(device);
}
}
}
catch (Exception ex)

View File

@ -114,7 +114,7 @@ namespace Plugin
public void LoadAllDrivers()
{
_logger.LogInformation("LoadAllDrivers Start");
Parallel.ForEach(_driverFiles, file =>
foreach (var file in _driverFiles)
{
try
{
@ -134,7 +134,7 @@ namespace Plugin
{
_logger.LogError(ex, $"LoadAllDrivers Error {file}");
}
});
};
_logger.LogInformation($"LoadAllDrivers End,Count{DriverInfos.Count}");
}