mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 17:02:27 +08:00
tech(alerting): change from array to map
This commit is contained in:
@ -7,16 +7,17 @@ import (
|
||||
)
|
||||
|
||||
type Executor interface {
|
||||
Execute(rule m.AlertRule) (err error, result AlertResult)
|
||||
Execute(rule m.AlertRule, responseQueue chan *AlertResult)
|
||||
}
|
||||
|
||||
type DummieExecutor struct{}
|
||||
|
||||
func (this DummieExecutor) Execute(rule m.AlertRule) (err error, result AlertResult) {
|
||||
if rule.Id == 6 {
|
||||
time.Sleep(time.Second * 60)
|
||||
}
|
||||
func (this DummieExecutor) Execute(rule m.AlertRule, responseQueue chan *AlertResult) {
|
||||
//if rule.Id == 6 {
|
||||
// time.Sleep(time.Second * 60)
|
||||
//}
|
||||
time.Sleep(time.Second)
|
||||
log.Info("Finnished executing: %d", rule.Id)
|
||||
return nil, AlertResult{state: "OK", id: rule.Id}
|
||||
responseQueue <- &AlertResult{state: "OK", id: rule.Id}
|
||||
//return nil,
|
||||
}
|
||||
|
Reference in New Issue
Block a user