Преглед на файлове

feat: restrict automatic channel testing to master node only

CaIon преди 7 месеца
родител
ревизия
28295e0168
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  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 {