Changed the loop as now we are looping over a map and not a slice.
This commit is contained in:
parent
710447cb0d
commit
f85ed944f4
2 changed files with 3 additions and 3 deletions
|
@ -43,7 +43,7 @@ func TasksFromJSON(uri string) ([]Task, error) {
|
|||
func (tsk *Task) UpdateHost(newHost string) bool {
|
||||
// Validation
|
||||
isCorrectHost := false
|
||||
for _, existingHost := range constants.Hosts {
|
||||
for existingHost, _ := range constants.Hosts {
|
||||
if newHost == existingHost {
|
||||
isCorrectHost = true
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package pcp
|
|||
import (
|
||||
"bitbucket.org/sunybingcloud/electron/constants"
|
||||
"bitbucket.org/sunybingcloud/electron/rapl"
|
||||
"bitbucket.org/sunybingcloud/electron/utilities"
|
||||
"bufio"
|
||||
"container/ring"
|
||||
"log"
|
||||
|
@ -14,7 +15,6 @@ import (
|
|||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
"bitbucket.org/sunybingcloud/electron/utilities"
|
||||
)
|
||||
|
||||
func round(num float64) int {
|
||||
|
@ -202,7 +202,7 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, pref
|
|||
// If cannot find any victim, then all nodes have been capped to the maximum and we stop capping at this point.
|
||||
}
|
||||
}
|
||||
if (!canCapAlreadyCappedVictim) {
|
||||
if !canCapAlreadyCappedVictim {
|
||||
log.Println("No Victim left to cap.")
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue