feat: enhance context cancellation handling

This commit is contained in:
Fu Diwei
2025-04-23 19:32:21 +08:00
parent a90b6a8589
commit 97f102533c
31 changed files with 287 additions and 57 deletions

View File

@@ -47,8 +47,10 @@ func (w *workflowInvoker) GetLogs() domain.WorkflowLogs {
func (w *workflowInvoker) processNode(ctx context.Context, node *domain.WorkflowNode) error {
current := node
for current != nil {
if ctx.Err() != nil {
select {
case <-ctx.Done():
return ctx.Err()
default:
}
if current.Type == domain.WorkflowNodeTypeBranch || current.Type == domain.WorkflowNodeTypeExecuteResultBranch {