diff --git a/shared.go b/shared.go index 1e52f98..8f84dc6 100755 --- a/shared.go +++ b/shared.go @@ -17719,6 +17719,8 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h log.Printf("\n\n[DEBUG][%s] Worker user input restart. What do? Should we ever reach this point?\n\n") } else { + updateMade := true + log.Printf("[DEBUG][%s] Re-adding user input execution to db & queue after re-setting result back", result.ExecutionId) oldExecution.Status = "EXECUTING" @@ -17731,6 +17733,7 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h err = SetWorkflowExecution(ctx, *oldExecution, true) if err != nil { + updateMade = false log.Printf("[ERROR] Failed setting workflow execution actionresult in execution: %s", err) } @@ -17752,8 +17755,13 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h err = SetWorkflowQueue(ctx, executionRequest, parsedEnv) if err != nil { + updateMade = false log.Printf("[ERROR] Failed re-adding User Input execution to db: %s", err) } + + if updateMade { + return *oldExecution, ExecInfo{}, "", errors.New("User Input: Execution action skipped!") + } } }