From 729b2b211d33a90b1844ff8d1f54857c9bfba2a6 Mon Sep 17 00:00:00 2001 From: Frikky Date: Tue, 23 Jan 2024 16:12:58 +0100 Subject: [PATCH] Added SHUFFLE_MAX_EXECUTION_DEPTH for subflows to be able to go lower than 10 subflows --- backend/app_sdk/app_base.py | 3 ++- backend/go-app/walkoff.go | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index 29aab5c9..6c4f05e6 100755 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -3289,7 +3289,8 @@ class AppBase: })) if parameter["name"] == "body": - self.logger.info(f"[INFO] Should debug field with liquid and other checks as it's BODY: {value}") + #self.logger.info(f"[INFO] Should debug field with liquid and other checks as it's BODY: {value}") + pass # Custom format for ${name[0,1,2,...]}$ #submatch = "([${]{2}([0-9a-zA-Z_-]+)(\[.*\])[}$]{2})" diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index 0bcada9c..3811b0e1 100755 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -1056,7 +1056,15 @@ func handleExecution(id string, workflow shuffle.Workflow, request *http.Request return shuffle.WorkflowExecution{}, fmt.Sprintf(`workflow %s is invalid`, workflow.ID), errors.New("Failed getting workflow") } - workflowExecution, execInfo, _, err := shuffle.PrepareWorkflowExecution(ctx, workflow, request, 10) + maxExecutionDepth := 10 + if os.Getenv("SHUFFLE_MAX_EXECUTION_DEPTH") != "" { + maxExecutionDepthNew, err = strconv.Atoi(os.Getenv("SHUFFLE_MAX_EXECUTION_DEPTH")) + if err == nil && maxExecutionDepthNew > 1 && maxExecutionDepthNew < 1000 { + maxExecutionDepth = maxExecutionDepthNew + } + } + + workflowExecution, execInfo, _, err := shuffle.PrepareWorkflowExecution(ctx, workflow, request, maxExecutionDepth) if err != nil { err = shuffle.SetWorkflowExecution(ctx, workflowExecution, true) if err != nil {