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:
2020-05-04 00:19:50 +08:00
parent dbe02d12ee
commit 488dfbbb2f

View File

@@ -14,7 +14,7 @@ import (
type ResourcePool struct { type ResourcePool struct {
poolsCount int poolsCount int
//pools []PoolSeg pools []PoolSeg
poolsMu sync.Mutex poolsMu sync.Mutex
history []PoolStatus history []PoolStatus
@@ -83,6 +83,19 @@ func (pool *ResourcePool) start() {
go func() { go func() {
pool.saveStatusHistory() pool.saveStatusHistory()
}() }()
segID := rand.Intn(pool.poolsCount)
start := &pool.pools[segID]
if start.Nodes == nil {
start = start.Next
}
for cur := start; ; {
log.Info(cur.ID)
cur = cur.Next
if cur.ID == start.ID {
break
}
}
} }
/* check dead nodes periodically */ /* check dead nodes periodically */