Skip to content

Commit

Permalink
Add max retries to SubmitJob
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbindreiter committed May 7, 2024
1 parent ad585e9 commit c41e6c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions workflows/v1/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewJobService(client workflowsv1connect.JobServiceClient) *JobService {
}
}

func (js *JobService) Submit(ctx context.Context, jobName, clusterSlug string, tasks ...Task) (*workflowsv1.Job, error) {
func (js *JobService) Submit(ctx context.Context, jobName, clusterSlug string, maxRetries int, tasks ...Task) (*workflowsv1.Job, error) {
if len(tasks) == 0 {
return nil, errors.New("no tasks to submit")
}
Expand Down Expand Up @@ -63,8 +63,9 @@ func (js *JobService) Submit(ctx context.Context, jobName, clusterSlug string, t
Name: identifier.Name(),
Version: identifier.Version(),
},
Input: subtaskInput,
Display: identifier.Display(),
Input: subtaskInput,
Display: identifier.Display(),
MaxRetries: int64(maxRetries),
})
}

Expand Down
2 changes: 1 addition & 1 deletion workflows/v1/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type badIdentifierTask struct {
}

func (t *badIdentifierTask) Identifier() TaskIdentifier {
return TaskIdentifier{Name: "", Version: ""}
return NewTaskIdentifier("", "")
}

func TestTaskRunner_RegisterTask(t *testing.T) {
Expand Down

0 comments on commit c41e6c9

Please sign in to comment.