Browse Source

publish peer update for hosts on update

Abhishek Kondur 2 years ago
parent
commit
d31b17489f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      controllers/hosts.go

+ 6 - 0
controllers/hosts.go

@@ -109,6 +109,12 @@ func updateHost(w http.ResponseWriter, r *http.Request) {
 		}
 	}
 
+	go func() {
+		if err := mq.PublishPeerUpdate(); err != nil {
+			logger.Log(0, "fail to publish peer update: ", err.Error())
+		}
+	}()
+
 	apiHostData := newHost.ConvertNMHostToAPI()
 	logger.Log(2, r.Header.Get("user"), "updated host", newHost.ID.String())
 	w.WriteHeader(http.StatusOK)