修复导出变量偶发丢失上传属性的问题

This commit is contained in:
Kimdiego2098
2023-12-12 22:41:10 +08:00
parent 3e6420ba6f
commit 106e740220

View File

@@ -270,13 +270,16 @@ public class VariableService : DbRepository<DeviceVariable>, IVariableService
{
//插件名称去除首部ThingsGateway.作为表名
var pluginName = driverPluginDicts[uploadDevice.PluginName].Name;
if (devicePropertys.ContainsKey(pluginName))
lock (devicePropertys)
{
devicePropertys[pluginName].Add(driverInfo);
}
else
{
devicePropertys.TryAdd(pluginName, new() { driverInfo });
if (devicePropertys.ContainsKey(pluginName))
{
devicePropertys[pluginName].Add(driverInfo);
}
else
{
devicePropertys.TryAdd(pluginName, new() { driverInfo });
}
}
}
}