并行启动采集线程
This commit is contained in:
parent
e9ee682f37
commit
68f217fa3f
@ -40,10 +40,7 @@ namespace Plugin
|
|||||||
.Include(x => x.Parent).Include(x => x.Driver).Include(x => x.DeviceConfigs)
|
.Include(x => x.Parent).Include(x => x.Driver).Include(x => x.DeviceConfigs)
|
||||||
.Include(x => x.DeviceVariables).AsNoTracking().ToList();
|
.Include(x => x.DeviceVariables).AsNoTracking().ToList();
|
||||||
_logger.LogInformation($"Loaded Devices Count:{devices.Count()}");
|
_logger.LogInformation($"Loaded Devices Count:{devices.Count()}");
|
||||||
foreach (var device in devices)
|
Parallel.ForEach(devices, CreateDeviceThread);
|
||||||
{
|
|
||||||
CreateDeviceThread(device);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
Loading…
Reference in New Issue
Block a user