diff --git a/Plugins/Plugin/DeviceService.cs b/Plugins/Plugin/DeviceService.cs index 88fbd24..408b92b 100644 --- a/Plugins/Plugin/DeviceService.cs +++ b/Plugins/Plugin/DeviceService.cs @@ -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) diff --git a/Plugins/Plugin/DrvierService.cs b/Plugins/Plugin/DrvierService.cs index 8c973e1..77beb30 100644 --- a/Plugins/Plugin/DrvierService.cs +++ b/Plugins/Plugin/DrvierService.cs @@ -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}"); }