add enabled field to channel
This commit is contained in:
parent
e6d08bc128
commit
3f5beb7c9f
|
@ -17,6 +17,7 @@ type Channel struct {
|
|||
SearchText string `json:"-" elastic_mapping:"search_text:{type:text,index_prefixes:{},index_phrases:true, analyzer:suggest_text_search }"`
|
||||
SubType string `json:"sub_type" elastic_mapping:"sub_type:{type:keyword,copy_to:search_text}"`
|
||||
Email *Email `json:"email,omitempty" elastic_mapping:"email:{type:object}"`
|
||||
Enabled bool `json:"enabled" elastic_mapping:"enabled:{type:boolean}"`
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -959,6 +959,9 @@ func performChannels(channels []alerting.Channel, ctx map[string]interface{}) ([
|
|||
var errCount int
|
||||
var actionResults []alerting.ActionExecutionResult
|
||||
for _, channel := range channels {
|
||||
if !channel.Enabled {
|
||||
continue
|
||||
}
|
||||
resBytes, err, messageBytes := common.PerformChannel(&channel, ctx)
|
||||
var errStr string
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue