Changing calls on functions that use JobUpdateKey to reflect change made for memory safety.

This commit is contained in:
Renan DelValle 2019-09-25 16:20:55 -07:00 committed by Renan DelValle
parent 4fc4953ec4
commit 235f854087
2 changed files with 7 additions and 3 deletions

View file

@ -377,7 +377,7 @@ func main() {
case "resumeJobUpdate": case "resumeJobUpdate":
key := job.JobKey() key := job.JobKey()
err := r.ResumeJobUpdate(&aurora.JobUpdateKey{ err := r.ResumeJobUpdate(aurora.JobUpdateKey{
Job: &key, Job: &key,
ID: updateId, ID: updateId,
}, "") }, "")
@ -388,7 +388,7 @@ func main() {
case "pulseJobUpdate": case "pulseJobUpdate":
key := job.JobKey() key := job.JobKey()
resp, err := r.PulseJobUpdate(&aurora.JobUpdateKey{ resp, err := r.PulseJobUpdate(aurora.JobUpdateKey{
Job: &key, Job: &key,
ID: updateId, ID: updateId,
}) })

View file

@ -365,7 +365,11 @@ pulseLoop:
for { for {
select { select {
case <-ticker.C: case <-ticker.C:
pulseStatus, err := r.PulseJobUpdate(result.GetKey()) if result.GetKey() == nil {
continue
}
pulseStatus, err := r.PulseJobUpdate(*result.GetKey())
assert.Nil(t, err) assert.Nil(t, err)
if pulseStatus != aurora.JobUpdatePulseStatus_OK && pulseStatus != aurora.JobUpdatePulseStatus_FINISHED { if pulseStatus != aurora.JobUpdatePulseStatus_OK && pulseStatus != aurora.JobUpdatePulseStatus_FINISHED {