并行加载驱动

This commit is contained in:
iioter 2023-10-21 22:12:40 +08:00
parent da79a78da7
commit e9ee682f37

View File

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