Procházet zdrojové kódy

feat: restrict automatic channel testing to master node only

CaIon před 4 měsíci
rodič
revize
3dc4d6c39e
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      controller/channel-test.go

+ 4 - 0
controller/channel-test.go

@@ -617,6 +617,10 @@ func TestAllChannels(c *gin.Context) {
 var autoTestChannelsOnce sync.Once
 
 func AutomaticallyTestChannels() {
+	// 只在Master节点定时测试渠道
+	if !common.IsMasterNode {
+		return
+	}
 	autoTestChannelsOnce.Do(func() {
 		for {
 			if !operation_setting.GetMonitorSetting().AutoTestChannelEnabled {