mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 08:47:35 +08:00
made node update with server more efficient
This commit is contained in:
@@ -96,11 +96,11 @@ func UpdateKeys(nodeCfg *config.ClientConfig, client mqtt.Client) error {
|
||||
ncutils.Log("error updating local config " + err.Error())
|
||||
}
|
||||
var commsCfg = getCommsCfgByNode(&nodeCfg.Node)
|
||||
PublishNodeUpdate(&commsCfg, nodeCfg)
|
||||
if err = wireguard.ApplyConf(&nodeCfg.Node, nodeCfg.Node.Interface, file); err != nil {
|
||||
ncutils.Log("error applying new config " + err.Error())
|
||||
return err
|
||||
}
|
||||
PublishNodeUpdate(&commsCfg, nodeCfg)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -93,12 +93,12 @@ func NodeUpdate(client mqtt.Client, msg mqtt.Message) {
|
||||
return
|
||||
}
|
||||
if ifaceDelta { // if a change caused an ifacedelta we need to notify the server to update the peers
|
||||
ackErr := publishSignal(&commsCfg, &nodeCfg, ncutils.ACK)
|
||||
if ackErr != nil {
|
||||
ncutils.Log("could not notify server that it received an interface update")
|
||||
} else {
|
||||
ncutils.Log("signalled acknowledgement of change to server")
|
||||
}
|
||||
// ackErr := publishSignal(&commsCfg, &nodeCfg, ncutils.ACK)
|
||||
// if ackErr != nil {
|
||||
// ncutils.Log("could not notify server that it received an interface update")
|
||||
// } else {
|
||||
// ncutils.Log("signalled acknowledgement of change to server")
|
||||
// }
|
||||
ncutils.Log("applying WG conf to " + file)
|
||||
err = wireguard.ApplyConf(&nodeCfg.Node, nodeCfg.Node.Interface, file)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user