Fixed a bug with workflow output

dev
Ice3man543 2020-12-29 20:32:04 +05:30
parent fe7a5def29
commit 27ef27a51b
2 changed files with 7 additions and 7 deletions

View File

@ -25,9 +25,8 @@ func (r *Runner) processTemplateWithList(template *templates.Template) bool {
match, err := template.Executer.Execute(URL)
if err != nil {
gologger.Warning().Msgf("[%s] Could not execute step: %s\n", r.colorizer.BrightBlue(template.ID), err)
} else {
results.CAS(false, match)
}
results.CAS(false, match)
}(URL)
return nil
})
@ -49,9 +48,8 @@ func (r *Runner) processWorkflowWithList(template *templates.Template) bool {
match, err := template.RunWorkflow(URL)
if err != nil {
gologger.Warning().Msgf("[%s] Could not execute step: %s\n", r.colorizer.BrightBlue(template.ID), err)
} else {
results.CAS(false, match)
}
results.CAS(false, match)
}(URL)
return nil
})

View File

@ -9,7 +9,7 @@ func (w *Workflow) RunWorkflow(input string) (bool, error) {
for _, template := range w.Workflows {
err := w.runWorkflowStep(template, input, results)
if err != nil {
return false, err
return results.Load(), err
}
}
return results.Load(), nil
@ -26,8 +26,10 @@ func (w *Workflow) runWorkflowStep(template *WorkflowTemplate, input string, res
if err != nil {
return err
}
firstMatched = matched
results.CAS(false, matched)
if matched {
firstMatched = matched
results.CAS(false, matched)
}
}
if len(template.Matchers) > 0 {