POC on how verification function would work. Update function should have something similar.

This commit is contained in:
Renán Del Valle 2021-04-29 20:08:19 -07:00
commit 34a41e86a8
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
2 changed files with 22 additions and 3 deletions

View file

@ -672,7 +672,23 @@ func (r *realisClient) CreateJob(auroraJob Job) (*aurora.Response, error) {
func() (*aurora.Response, error) {
return r.client.CreateJob(context.TODO(), auroraJob.JobConfig())
},
nil,
func() (*aurora.Response, bool) {
getTaskResp, err := r.client.GetTasksStatus(
context.TODO(),
&aurora.TaskQuery{JobKeys: []*aurora.JobKey{auroraJob.JobKey()}},
)
if err != nil {
return nil, false
}
tasks := response.ScheduleStatusResult(getTaskResp).GetTasks()
if len(tasks) != int(auroraJob.GetInstanceCount()) {
return nil, false
}
return nil, true
},
)
if retryErr != nil {