diff --git a/nomad/job_endpoint.go b/nomad/job_endpoint.go index cb58740c0..6e8c1ab59 100644 --- a/nomad/job_endpoint.go +++ b/nomad/job_endpoint.go @@ -934,7 +934,7 @@ func (j *Job) Scale(args *structs.JobScaleRequest, reply *structs.JobRegisterRes reply.JobModifyIndex = job.ModifyIndex } - // only create an eval for non-dispatch jobs and if the count was provided + // Only create an eval for non-dispatch jobs and if the count was provided // for now, we'll do this even if count didn't change if !job.IsPeriodic() && !job.IsParameterized() && args.Count != nil { eval := &structs.Evaluation{ diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index 1f6838965..789692107 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -654,12 +654,12 @@ func (s *StateStore) UpsertScalingEvent(index uint64, req *structs.ScalingEventR req.ScalingEvent.CreateIndex = index events := jobEvents.ScalingEvents[req.TaskGroup] - // prepend this latest event + // Prepend this latest event events = append( []*structs.ScalingEvent{req.ScalingEvent}, events..., ) - // truncate older events + // Truncate older events if len(events) > structs.JobTrackedScalingEvents { events = events[0:structs.JobTrackedScalingEvents] }