| 1016 | } |
| 1017 | |
| 1018 | func selectChannelsForAutomaticTest(channels []*model.Channel, mode string) []*model.Channel { |
| 1019 | selected := make([]*model.Channel, 0, len(channels)) |
| 1020 | for _, channel := range channels { |
| 1021 | if channel.Status == common.ChannelStatusManuallyDisabled { |
| 1022 | continue |
| 1023 | } |
| 1024 | if mode == operation_setting.ChannelTestModePassiveRecovery && channel.Status != common.ChannelStatusAutoDisabled { |
| 1025 | continue |
| 1026 | } |
| 1027 | selected = append(selected, channel) |
| 1028 | } |
| 1029 | return selected |
| 1030 | } |
| 1031 | |
| 1032 | // TestAllChannels enqueues a channel_test system task instead of running the |
| 1033 | // test loop inline. If any channel_test task is already active, the manual run is |