Skip to content

Commit

Permalink
Fix linting and better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Preetha Appan committed Sep 24, 2018
1 parent 992c243 commit 282a027
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nomad/plan_apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (s *Server) applyPlan(plan *structs.Plan, result *structs.PlanResult, snap
}

var evals []*structs.Evaluation
for preemptedJobID, _ := range preemptedJobIDs {
for preemptedJobID := range preemptedJobIDs {
job, _ := s.State().JobByID(nil, preemptedJobID.Namespace, preemptedJobID.ID)
if job != nil {
eval := &structs.Evaluation{
Expand Down
3 changes: 2 additions & 1 deletion scheduler/preemption.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ func preemptForNetworkResourceAsk(jobPriority int, currentAllocs []*structs.Allo

// If bandwidth requirements have been met, stop
if preemptedBandwidth+freeBandwidth >= MbitsNeeded {
met = true
break
}

Expand Down Expand Up @@ -407,10 +406,12 @@ func preemptForNetworkResourceAsk(jobPriority int, currentAllocs []*structs.Allo
break
}
}
// If we met bandwidth needs we can break out of loop that's iterating by priority within a device
if met {
break
}
}
// If we met bandwidth needs we can break out of loop that's iterating by allocs sharing the same network device
if met {
break
}
Expand Down

0 comments on commit 282a027

Please sign in to comment.