mirror of
https://github.com/gravitl/netmaker.git
synced 2024-09-20 23:36:18 +08:00
Merge pull request #1886 from gravitl/netclient_refactor_fixes
Netclient refactor fixes
This commit is contained in:
commit
f382fd3bf9
|
@ -1089,7 +1089,14 @@ func deleteNode(w http.ResponseWriter, r *http.Request) {
|
|||
logger.Log(1, r.Header.Get("user"), "Deleted node", nodeid, "from network", params["network"])
|
||||
if !fromNode {
|
||||
runUpdates(&node, false)
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
if err := mq.PublishPeerUpdate(node.Network, false); err != nil {
|
||||
logger.Log(1, "error publishing peer update ", err.Error())
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ func SetNodeDefaults(node *models.Node) {
|
|||
}
|
||||
|
||||
if node.PersistentKeepalive == 0 {
|
||||
node.PersistentKeepalive = time.Duration(parentNetwork.DefaultKeepalive)
|
||||
node.PersistentKeepalive = time.Second * time.Duration(parentNetwork.DefaultKeepalive)
|
||||
}
|
||||
if node.PostUp == "" {
|
||||
postup := parentNetwork.DefaultPostUp
|
||||
|
|
|
@ -69,7 +69,7 @@ func (a *ApiNode) ConvertToServerNode(currentNode *Node) *Node {
|
|||
convertedNode.DNSOn = a.DNSOn
|
||||
convertedNode.EgressGatewayRequest = currentNode.EgressGatewayRequest
|
||||
convertedNode.EgressGatewayNatEnabled = currentNode.EgressGatewayNatEnabled
|
||||
convertedNode.PersistentKeepalive = time.Duration(a.PersistentKeepalive)
|
||||
convertedNode.PersistentKeepalive = time.Second * time.Duration(a.PersistentKeepalive)
|
||||
convertedNode.RelayAddrs = a.RelayAddrs
|
||||
convertedNode.DefaultACL = a.DefaultACL
|
||||
convertedNode.OwnerID = currentNode.OwnerID
|
||||
|
@ -128,7 +128,7 @@ func (nm *Node) ConvertToAPINode() *ApiNode {
|
|||
}
|
||||
apiNode.PostDown = nm.PostDown
|
||||
apiNode.PostUp = nm.PostUp
|
||||
apiNode.PersistentKeepalive = int32(nm.PersistentKeepalive)
|
||||
apiNode.PersistentKeepalive = int32(nm.PersistentKeepalive.Seconds())
|
||||
apiNode.LastModified = nm.LastModified.Unix()
|
||||
apiNode.LastCheckIn = nm.LastCheckIn.Unix()
|
||||
apiNode.LastPeerUpdate = nm.LastPeerUpdate.Unix()
|
||||
|
|
Loading…
Reference in a new issue