Browse Source

comment fallback metrics update

abhishek9686 1 year ago
parent
commit
70f3cbc98f
2 changed files with 4 additions and 1 deletions
  1. 1 1
      controllers/hosts.go
  2. 3 0
      pro/logic/metrics.go

+ 1 - 1
controllers/hosts.go

@@ -254,7 +254,7 @@ func hostUpdateFallback(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 	case models.UpdateMetrics:
-		mq.UpdateMetricsFallBack(hostUpdate.Node.ID.String(), hostUpdate.NewMetrics)
+		// mq.UpdateMetricsFallBack(hostUpdate.Node.ID.String(), hostUpdate.NewMetrics)
 	}
 	logic.ReturnSuccessResponse(w, r, "updated host data")
 

+ 3 - 0
pro/logic/metrics.go

@@ -118,6 +118,9 @@ func updateNodeMetrics(currentNode *models.Node, newMetrics *models.Metrics) {
 			attachedClients = clients
 		}
 	}
+	if newMetrics.Connectivity == nil {
+		newMetrics.Connectivity = make(map[string]models.Metric)
+	}
 	if len(attachedClients) > 0 {
 		// associate ext clients with IDs
 		for i := range attachedClients {