1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-15 08:16:43 +00:00
This commit is contained in:
2019-07-10 20:40:43 +08:00
parent ad1497bfbd
commit c42154696e
10 changed files with 154 additions and 115 deletions

View File

@@ -5,11 +5,10 @@ import (
"time"
"net/url"
"strings"
"log"
log "github.com/sirupsen/logrus"
"math/rand"
"strconv"
"fmt"
)
)
type ResourcePool struct {
mu sync.Mutex
@@ -111,8 +110,7 @@ func (pool *ResourcePool) update(node NodeStatus) {
}
pool.nodes[node.ClientID] = node
pool.heartBeat[node.ClientID] = time.Now()
//log.Println(pool.nodes)
log.Debug(pool.nodes)
}
func (pool *ResourcePool) getByID(id string) NodeStatus {
@@ -138,7 +136,7 @@ func (pool *ResourcePool) acquireNetwork() string {
pool.networkMu.Lock()
defer pool.networkMu.Unlock()
var network string
fmt.Println(pool.networksFree)
log.Info(pool.networksFree)
if len(pool.networksFree) == 0 {
for {
for {