|
|
@ -128,12 +128,15 @@ func (pool *NodePool) Add(node *model.Node) {
|
|
|
|
defer pool.buildIndexMap()
|
|
|
|
defer pool.buildIndexMap()
|
|
|
|
defer pool.lock.Unlock()
|
|
|
|
defer pool.lock.Unlock()
|
|
|
|
|
|
|
|
|
|
|
|
if _, ok := pool.active[node.ID]; ok {
|
|
|
|
var (
|
|
|
|
// TODO: refresh node
|
|
|
|
old Node
|
|
|
|
return
|
|
|
|
ok bool
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
if old, ok = pool.active[node.ID]; !ok {
|
|
|
|
|
|
|
|
old, ok = pool.inactive[node.ID]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if old != nil {
|
|
|
|
if _, ok := pool.inactive[node.ID]; ok {
|
|
|
|
old.Init(node)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|