Sfoglia il codice sorgente

feat: restrict automatic channel testing to master node only

CaIon 4 mesi fa
parent
commit
3dc4d6c39e
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  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 {