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.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
} }

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

Loading…
Cancel
Save