From 7bec30c2b32f051905c3ec6d175424fcc8a01ae3 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Wed, 16 Dec 2015 14:27:40 -0800 Subject: [PATCH] Small cleanup --- nomad/core_sched.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nomad/core_sched.go b/nomad/core_sched.go index ed096a53f..f557c9285 100644 --- a/nomad/core_sched.go +++ b/nomad/core_sched.go @@ -43,7 +43,7 @@ func (s *CoreScheduler) Process(eval *structs.Evaluation) error { // jobGC is used to garbage collect eligible jobs. func (c *CoreScheduler) jobGC(eval *structs.Evaluation) error { // Get all the jobs eligible for garbage collection. - jIter, err := c.snap.JobsByGC(true) + iter, err := c.snap.JobsByGC(true) if err != nil { return err } @@ -55,16 +55,16 @@ func (c *CoreScheduler) jobGC(eval *structs.Evaluation) error { c.srv.logger.Printf("[DEBUG] sched.core: job GC: scanning before index %d (%v)", oldThreshold, c.srv.config.JobGCThreshold) - // Collect the allocations and evaluations to GC + // Collect the allocations, evaluations and jobs to GC var gcAlloc, gcEval, gcJob []string OUTER: - for i := jIter.Next(); i != nil; i = jIter.Next() { + for i := iter.Next(); i != nil; i = iter.Next() { job := i.(*structs.Job) // Ignore new jobs. if job.CreateIndex > oldThreshold { - continue OUTER + continue } evals, err := c.snap.EvalsByJob(job.ID)