浏览代码

add mq removal on host delete

0xdcarns 3 年之前
父节点
当前提交
4877bdccf1
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      controllers/hosts.go

+ 4 - 0
controllers/hosts.go

@@ -130,6 +130,10 @@ func deleteHost(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
+	if err = mq.DeleteMqClient(currHost.ID.String()); err != nil {
+		logger.Log(0, "error removing DynSec credentials for host:", currHost.Name, err.Error())
+	}
+
 	apiHostData := currHost.ConvertNMHostToAPI()
 	logger.Log(2, r.Header.Get("user"), "removed host", currHost.Name)
 	w.WriteHeader(http.StatusOK)