From fd6bff23329f47f8360d6b2c5aece10982674b8b Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Sun, 23 Sep 2018 21:26:24 -0500 Subject: [PATCH] Fix linting and better comments --- scheduler/preemption.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scheduler/preemption.go b/scheduler/preemption.go index f3a80d272..1eb2d2f32 100644 --- a/scheduler/preemption.go +++ b/scheduler/preemption.go @@ -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 } @@ -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 }