浏览代码

moved log to reflect when message is actually consumed

0xdcarns 3 年之前
父节点
当前提交
e76db659be
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      netclient/functions/mqhandlers.go

+ 1 - 1
netclient/functions/mqhandlers.go

@@ -44,13 +44,13 @@ func NodeUpdate(client mqtt.Client, msg mqtt.Message) {
 		return
 		return
 	}
 	}
 
 
-	logger.Log(0, "received message to update node "+newNode.Name)
 	// see if cache hit, if so skip
 	// see if cache hit, if so skip
 	var currentMessage = read(newNode.Network, lastNodeUpdate)
 	var currentMessage = read(newNode.Network, lastNodeUpdate)
 	if currentMessage == string(data) {
 	if currentMessage == string(data) {
 		return
 		return
 	}
 	}
 	insert(newNode.Network, lastNodeUpdate, string(data)) // store new message in cache
 	insert(newNode.Network, lastNodeUpdate, string(data)) // store new message in cache
+	logger.Log(0, "received message to update node "+newNode.Name)
 
 
 	// ensure that OS never changes
 	// ensure that OS never changes
 	newNode.OS = runtime.GOOS
 	newNode.OS = runtime.GOOS