do checkin after mq is connected, publish metrics only when node is connected

This commit is contained in:
Abhishek Kondur
2022-10-05 21:21:34 +05:30
parent 77c901e4d9
commit fe5fd7fce9
2 changed files with 11 additions and 2 deletions

View File

@@ -107,7 +107,7 @@ func checkin() {
config.Write(&nodeCfg, nodeCfg.Network)
}
Hello(&nodeCfg)
if nodeCfg.Server.Is_EE {
if nodeCfg.Server.Is_EE && nodeCfg.Node.Connected == "yes" {
logger.Log(0, "collecting metrics for node", nodeCfg.Node.Name)
publishMetrics(&nodeCfg)
}