mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 08:47:35 +08:00
fix keepalive conversion type
This commit is contained in:
@@ -243,7 +243,7 @@ func SetNodeDefaults(node *models.Node) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if node.PersistentKeepalive == 0 {
|
if node.PersistentKeepalive == 0 {
|
||||||
node.PersistentKeepalive = time.Duration(parentNetwork.DefaultKeepalive)
|
node.PersistentKeepalive = time.Second * time.Duration(parentNetwork.DefaultKeepalive)
|
||||||
}
|
}
|
||||||
if node.PostUp == "" {
|
if node.PostUp == "" {
|
||||||
postup := parentNetwork.DefaultPostUp
|
postup := parentNetwork.DefaultPostUp
|
||||||
|
@@ -69,7 +69,7 @@ func (a *ApiNode) ConvertToServerNode(currentNode *Node) *Node {
|
|||||||
convertedNode.DNSOn = a.DNSOn
|
convertedNode.DNSOn = a.DNSOn
|
||||||
convertedNode.EgressGatewayRequest = currentNode.EgressGatewayRequest
|
convertedNode.EgressGatewayRequest = currentNode.EgressGatewayRequest
|
||||||
convertedNode.EgressGatewayNatEnabled = currentNode.EgressGatewayNatEnabled
|
convertedNode.EgressGatewayNatEnabled = currentNode.EgressGatewayNatEnabled
|
||||||
convertedNode.PersistentKeepalive = time.Duration(a.PersistentKeepalive)
|
convertedNode.PersistentKeepalive = time.Second * time.Duration(a.PersistentKeepalive)
|
||||||
convertedNode.RelayAddrs = a.RelayAddrs
|
convertedNode.RelayAddrs = a.RelayAddrs
|
||||||
convertedNode.DefaultACL = a.DefaultACL
|
convertedNode.DefaultACL = a.DefaultACL
|
||||||
convertedNode.OwnerID = currentNode.OwnerID
|
convertedNode.OwnerID = currentNode.OwnerID
|
||||||
@@ -128,7 +128,7 @@ func (nm *Node) ConvertToAPINode() *ApiNode {
|
|||||||
}
|
}
|
||||||
apiNode.PostDown = nm.PostDown
|
apiNode.PostDown = nm.PostDown
|
||||||
apiNode.PostUp = nm.PostUp
|
apiNode.PostUp = nm.PostUp
|
||||||
apiNode.PersistentKeepalive = int32(nm.PersistentKeepalive)
|
apiNode.PersistentKeepalive = int32(nm.PersistentKeepalive.Seconds())
|
||||||
apiNode.LastModified = nm.LastModified.Unix()
|
apiNode.LastModified = nm.LastModified.Unix()
|
||||||
apiNode.LastCheckIn = nm.LastCheckIn.Unix()
|
apiNode.LastCheckIn = nm.LastCheckIn.Unix()
|
||||||
apiNode.LastPeerUpdate = nm.LastPeerUpdate.Unix()
|
apiNode.LastPeerUpdate = nm.LastPeerUpdate.Unix()
|
||||||
|
Reference in New Issue
Block a user