mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 11:56:39 +08:00
added beginning of re sub logic
This commit is contained in:
parent
dc93bd084e
commit
1ef52077a7
1 changed files with 1 additions and 1 deletions
|
@ -115,7 +115,6 @@ var All mqtt.MessageHandler = func(client mqtt.Client, msg mqtt.Message) {
|
|||
|
||||
// NodeUpdate -- mqtt message handler for /update/<NodeID> topic
|
||||
func NodeUpdate(client mqtt.Client, msg mqtt.Message) {
|
||||
ncutils.Log("received message to update node " + string(msg.Payload()))
|
||||
//potentiall blocking i/o so do this in a go routine
|
||||
go func() {
|
||||
var newNode models.Node
|
||||
|
@ -125,6 +124,7 @@ func NodeUpdate(client mqtt.Client, msg mqtt.Message) {
|
|||
ncutils.Log("error unmarshalling node update data" + err.Error())
|
||||
return
|
||||
}
|
||||
ncutils.Log("received message to update node " + newNode.Name)
|
||||
// see if cache hit, if so skip
|
||||
var currentMessage = read(newNode.Network, lastNodeUpdate)
|
||||
if currentMessage == string(msg.Payload()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue