Skip to content

Commit

Permalink
Attempting user input fix
Browse files Browse the repository at this point in the history
  • Loading branch information
frikky committed May 19, 2024
1 parent 151daf2 commit 68fac9e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
13 changes: 7 additions & 6 deletions db-connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -3168,7 +3168,7 @@ func GetAllWorkflowsByQuery(ctx context.Context, user User) ([]Workflow, error)

for {
innerWorkflow := Workflow{}
_, err := it.Next(&innerWorkflow)
_, err = it.Next(&innerWorkflow)
if err != nil {
if strings.Contains(fmt.Sprintf("%s", err), "cannot load field") {
log.Printf("[ERROR] Fixing workflow %s to have proper org (0.8.74)", innerWorkflow.ID)
Expand Down Expand Up @@ -3197,8 +3197,8 @@ func GetAllWorkflowsByQuery(ctx context.Context, user User) ([]Workflow, error)
}

if err != iterator.Done {
//log.Printf("[INFO] Failed fetching results: %v", err)
//break
log.Printf("[INFO] Failed fetching workflow results: %v", err)
break
}

// Get the cursor for the next page of results.
Expand All @@ -3217,16 +3217,17 @@ func GetAllWorkflowsByQuery(ctx context.Context, user User) ([]Workflow, error)
}
}

//log.Printf("[INFO] Appending suborg distribution workflows for organization %s (%s)", user.ActiveOrg.Name, user.ActiveOrg.Id)

log.Printf("[INFO] Appending suborg distribution workflows for organization %s (%s)", user.ActiveOrg.Name, user.ActiveOrg.Id)
cursorStr = ""
query = datastore.NewQuery(nameKey).Filter("suborg_distribution =", user.ActiveOrg.Id)
for {
it := project.Dbclient.Run(ctx, query)

for {
innerWorkflow := Workflow{}
_, err := it.Next(&innerWorkflow)
_, err = it.Next(&innerWorkflow)
log.Printf("[DEBUG] SUBFLOW: %#v", innerWorkflow.ID)

if err != nil {
if strings.Contains(fmt.Sprintf("%s", err), "cannot load field") {
log.Printf("[ERROR] Error in workflow loading. Migrating workflow to new workflow handler (1): %s", err)
Expand Down
12 changes: 11 additions & 1 deletion shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -11881,7 +11881,17 @@ func ParsedExecutionResult(ctx context.Context, workflowExecution WorkflowExecut
setWorkflow := false
if strings.ToLower(actionResult.Action.Environment) != "cloud" {
if project.Environment == "worker" {
log.Printf("\n\n\n[DEBUG] NOT modifying workflow based on User Input as we are in worker\n\n\n")

if os.Getenv("SHUFFLE_SWARM_CONFIG") == "run" || os.Getenv("SHUFFLE_SWARM_CONFIG") == "swarm" {
log.Printf("\n\n\n[DEBUG] MODIFYING workflow based on User Input as we are in swarm\n\n\n")

workflowExecution.Status = "WAITING"
workflowExecution.Results = append(workflowExecution.Results, actionResult)
setWorkflow = true
} else {
log.Printf("\n\n\n[DEBUG] NOT modifying workflow based on User Input as we are in worker\n\n\n")
}

} else {
// Find the waiting node and change it to this result
workflowExecution.Status = "WAITING"
Expand Down

0 comments on commit 68fac9e

Please sign in to comment.