优化了输出提示

This commit is contained in:
fengjiayi
2024-12-10 23:58:49 +08:00
parent 0f46b7ef63
commit dbbaa10cc0
11 changed files with 84 additions and 49 deletions

View File

@@ -254,7 +254,8 @@ namespace Serein.NodeFlow
try
{
await startNode.StartFlowAsync(Context); // 开始运行时从起始节点开始运行
if (flipflopNodes.Count > 0)
{
env.FlipFlopState = RunState.Running;
@@ -269,7 +270,8 @@ namespace Serein.NodeFlow
}).ToArray();
_ = Task.WhenAll(tasks);
}
await startNode.StartFlowAsync(Context); // 开始运行时从起始节点开始运行
// 等待结束
if(env.FlipFlopState == RunState.Running && _flipFlopCts is not null)
{
@@ -391,7 +393,7 @@ namespace Serein.NodeFlow
}
catch (FlipflopException ex)
{
env.WriteLine(InfoType.ERROR,$"触发器[{singleFlipFlopNode.MethodDetails.MethodName}]因非预期异常终止。"+ex.Message);
SereinEnv.WriteLine(InfoType.ERROR,$"触发器[{singleFlipFlopNode.MethodDetails.MethodName}]因非预期异常终止。"+ex.Message);
if (ex.Type == FlipflopException.CancelClass.CancelFlow)
{
break;
@@ -399,13 +401,9 @@ namespace Serein.NodeFlow
}
catch (Exception ex)
{
env.WriteLine(InfoType.ERROR, $"触发器[{singleFlipFlopNode.Guid}]异常。"+ ex.Message);
SereinEnv.WriteLine(InfoType.ERROR, $"触发器[{singleFlipFlopNode.Guid}]异常。"+ ex.Message);
//await Console.Out.WriteLineAsync(ex.Message);
}
finally
{
}
}
}