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 {
|
func (tsk *Task) UpdateHost(newHost string) bool {
|
||||||
// Validation
|
// Validation
|
||||||
isCorrectHost := false
|
isCorrectHost := false
|
||||||
for _, existingHost := range constants.Hosts {
|
for existingHost, _ := range constants.Hosts {
|
||||||
if newHost == existingHost {
|
if newHost == existingHost {
|
||||||
isCorrectHost = true
|
isCorrectHost = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package pcp
|
||||||
import (
|
import (
|
||||||
"bitbucket.org/sunybingcloud/electron/constants"
|
"bitbucket.org/sunybingcloud/electron/constants"
|
||||||
"bitbucket.org/sunybingcloud/electron/rapl"
|
"bitbucket.org/sunybingcloud/electron/rapl"
|
||||||
|
"bitbucket.org/sunybingcloud/electron/utilities"
|
||||||
"bufio"
|
"bufio"
|
||||||
"container/ring"
|
"container/ring"
|
||||||
"log"
|
"log"
|
||||||
|
@ -14,7 +15,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
"bitbucket.org/sunybingcloud/electron/utilities"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func round(num float64) int {
|
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 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.")
|
log.Println("No Victim left to cap.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue