Skip to content

Commit

Permalink
Fix update handler for unexisting job
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartłomiej Święcki authored and mlowicki committed Jul 31, 2019
1 parent 04276eb commit 5770085
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mesos/jobsscheduler/jobsscheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/gofrs/uuid"
"github.com/gogo/protobuf/proto"
"github.com/mesos/mesos-go/api/v1/lib"
mesos "github.com/mesos/mesos-go/api/v1/lib"
"github.com/mesos/mesos-go/api/v1/lib/resources"
"github.com/mlowicki/rhythm/model"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -53,7 +53,12 @@ func (sched *Scheduler) getJob(jid string) (model.Job, bool) {
sched.jobsMut.Lock()
job, ok := sched.jobs[jid]
sched.jobsMut.Unlock()
return *job, ok

if !ok {
return model.Job{}, false
}

return *job, true
}

func (sched *Scheduler) dequeueJob(job *model.Job) {
Expand Down

0 comments on commit 5770085

Please sign in to comment.