Fix: node cannot be reloaded when db model changes

pull/1048/head
HFO4 3 years ago
parent 22bbfe7da1
commit 1f06ee3af6

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

@ -24,6 +24,7 @@ func (service *AddNodeService) Add() serializer.Response {
}
}
cluster.Default.Add(&service.Node)
return serializer.Response{Data: service.Node.ID}
}

Loading…
Cancel
Save