mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
fixed update issue
This commit is contained in:
@@ -52,6 +52,16 @@ func GetNetworkNodesMemory(allNodes []models.Node, network string) []models.Node
|
||||
return nodes
|
||||
}
|
||||
|
||||
// UpdateNodeCheckin - updates the checkin time of a node
|
||||
func UpdateNodeCheckin(node *models.Node) error {
|
||||
node.SetLastCheckIn()
|
||||
data, err := json.Marshal(node)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return database.Insert(node.ID.String(), string(data), database.NODES_TABLE_NAME)
|
||||
}
|
||||
|
||||
// UpdateNode - takes a node and updates another node with it's values
|
||||
func UpdateNode(currentNode *models.Node, newNode *models.Node) error {
|
||||
if newNode.Address.IP.String() != currentNode.Address.IP.String() {
|
||||
|
Reference in New Issue
Block a user