File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -441,8 +441,12 @@ func (wflow *Workflow) Invoke(r *Request) error {
441441
442442 for len (progress .ReadyToExecute ) > 0 {
443443 decision , err := offloadingPolicy .Evaluate (r , progress )
444- if err == nil && decision .Offload {
445444
445+ if err != nil {
446+ return fmt .Errorf ("an error occurred in policy evaluation: %v" , err )
447+ }
448+
449+ if decision .Offload {
446450 err := progress .Save ()
447451 if err != nil {
448452 return fmt .Errorf ("Could not save progress: %v" , err )
@@ -471,7 +475,7 @@ func (wflow *Workflow) Invoke(r *Request) error {
471475 return fmt .Errorf ("Could not retrieve progress after offloading: %v" , err )
472476 }
473477 log .Printf ("Ready to execute after offloading: %v" , progress .ReadyToExecute )
474- } else if err == nil {
478+ } else {
475479 // pick next executable task
476480 var taskToExecute TaskId = ""
477481 for _ , task := range progress .ReadyToExecute {
@@ -537,8 +541,6 @@ func (wflow *Workflow) Invoke(r *Request) error {
537541
538542 return nil
539543 }
540- } else {
541- return fmt .Errorf ("an error occurred in policy evaluation: %v" , err )
542544 }
543545
544546 }
You can’t perform that action at this time.
0 commit comments