Skip to content

Commit

Permalink
πŸ‘Œ IMPROVE: check if the total number of actions is more than 1
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Gahlot <[email protected]>
  • Loading branch information
gauravgahlot committed Apr 29, 2022
1 parent 1e94ce1 commit eed0730
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/dbserver_worker_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ func (s *DBServer) ReportActionStatus(ctx context.Context, req *workflow.Workflo
actionIndex++
}
}
if actionIndex == wfContext.TotalNumberOfActions-1 {

if wfContext.TotalNumberOfActions > 1 && actionIndex == wfContext.TotalNumberOfActions-1 {
return nil, status.Errorf(codes.FailedPrecondition, errInvalidActionIndex)
}

action := wfActions.ActionList[actionIndex]
if action.GetTaskName() != req.GetTaskName() {
return nil, status.Errorf(codes.InvalidArgument, errInvalidTaskReported)
Expand Down

0 comments on commit eed0730

Please sign in to comment.