浏览代码

send peer update domain resolution update

abhishek9686 4 周之前
父节点
当前提交
ddad018de6
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 3 1
      controllers/egress.go
  2. 1 0
      controllers/hosts.go

+ 3 - 1
controllers/egress.go

@@ -141,8 +141,10 @@ func createEgress(w http.ResponseWriter, r *http.Request) {
 			}
 		}
 
+	} else {
+		go mq.PublishPeerUpdate(false)
 	}
-	go mq.PublishPeerUpdate(false)
+
 	logic.ReturnSuccessResponseWithJson(w, r, e, "created egress resource")
 }
 

+ 1 - 0
controllers/hosts.go

@@ -402,6 +402,7 @@ func hostUpdateFallback(w http.ResponseWriter, r *http.Request) {
 			e.Range = strings.Join(hostUpdate.Node.EgressGatewayRanges, ",")
 			e.Update(db.WithContext(r.Context()))
 		}
+		sendPeerUpdate = true
 	}
 
 	if sendPeerUpdate {