mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-20 10:50:48 +08:00
10.9.35
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<PluginVersion>10.9.34</PluginVersion>
|
||||
<ProPluginVersion>10.9.34</ProPluginVersion>
|
||||
<DefaultVersion>10.9.34</DefaultVersion>
|
||||
<PluginVersion>10.9.35</PluginVersion>
|
||||
<ProPluginVersion>10.9.35</ProPluginVersion>
|
||||
<DefaultVersion>10.9.35</DefaultVersion>
|
||||
<AuthenticationVersion>2.9.16</AuthenticationVersion>
|
||||
<SourceGeneratorVersion>10.9.15</SourceGeneratorVersion>
|
||||
<NET8Version>8.0.18</NET8Version>
|
||||
|
@@ -81,6 +81,7 @@ public static class CSharpScriptEngineExtension
|
||||
/// </summary>
|
||||
public static T Do<T>(string source, params Assembly[] assemblies) where T : class
|
||||
{
|
||||
if (source.IsNullOrEmpty()) return null;
|
||||
var field = $"{CacheKey}-{source}";
|
||||
var runScript = Instance.Get<T>(field);
|
||||
if (runScript == null)
|
||||
|
@@ -91,7 +91,7 @@ public class ExecuteScriptNode : TextNode, IActuatorNode, IExexcuteExpressionsBa
|
||||
try
|
||||
{
|
||||
var exexcuteExpressions = CSharpScriptEngineExtension.Do<IExexcuteExpressions>(text);
|
||||
exexcuteExpressions.TryDispose();
|
||||
exexcuteExpressions?.TryDispose();
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -110,6 +110,10 @@ public class ExecuteScriptNode : TextNode, IActuatorNode, IExexcuteExpressionsBa
|
||||
{
|
||||
Logger?.Trace($"Execute script");
|
||||
var exexcuteExpressions = CSharpScriptEngineExtension.Do<IExexcuteExpressions>(Text);
|
||||
if (exexcuteExpressions == null)
|
||||
{
|
||||
return new OperResult<NodeOutput>("exexcuteExpressions is null");
|
||||
}
|
||||
exexcuteExpressions.Logger = Logger;
|
||||
var data = await exexcuteExpressions.ExecuteAsync(input, cancellationToken).ConfigureAwait(false);
|
||||
return new OperResult<NodeOutput>() { Content = data };
|
||||
@@ -125,18 +129,19 @@ public class ExecuteScriptNode : TextNode, IActuatorNode, IExexcuteExpressionsBa
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (text.IsNullOrWhiteSpace())
|
||||
return;
|
||||
try
|
||||
{
|
||||
var exexcuteExpressions = CSharpScriptEngineExtension.Do<IExexcuteExpressions>(text);
|
||||
exexcuteExpressions.TryDispose();
|
||||
}
|
||||
catch
|
||||
if (!text.IsNullOrWhiteSpace())
|
||||
{
|
||||
try
|
||||
{
|
||||
var exexcuteExpressions = CSharpScriptEngineExtension.Do<IExexcuteExpressions>(text);
|
||||
exexcuteExpressions.TryDispose();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
CSharpScriptEngineExtension.Remove(text);
|
||||
}
|
||||
CSharpScriptEngineExtension.Remove(text);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
@@ -54,9 +54,11 @@ public partial class OpcUaServer : BusinessBase
|
||||
//opcua类库内部有大量缓存,如果刷新变量次数大于一定数量,应该重启服务以防止OOM
|
||||
if (Interlocked.Increment(ref VariableChangedCount) > 100)
|
||||
{
|
||||
await Task.Delay(1000, cancellationToken).ConfigureAwait(false);
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
await DeviceThreadManage.RestartDeviceAsync(CurrentDevice, false).ConfigureAwait(false);
|
||||
if (!cancellationToken.IsCancellationRequested)
|
||||
await DeviceThreadManage.RestartDeviceAsync(CurrentDevice, false).ConfigureAwait(false);
|
||||
}
|
||||
, cancellationToken);
|
||||
return;
|
||||
@@ -122,6 +124,7 @@ public partial class OpcUaServer : BusinessBase
|
||||
}
|
||||
private void UaDispose()
|
||||
{
|
||||
ApplicationInstance.MessageDlg = null;
|
||||
m_server?.Stop();
|
||||
m_server?.NodeManager?.SafeDispose();
|
||||
m_server?.SafeDispose();
|
||||
|
Reference in New Issue
Block a user