executor.go 530 B

1234567891011121314151617181920212223
  1. package alerting
  2. import (
  3. "github.com/grafana/grafana/pkg/log"
  4. m "github.com/grafana/grafana/pkg/models"
  5. "time"
  6. )
  7. type Executor interface {
  8. Execute(rule m.AlertRule, responseQueue chan *AlertResult)
  9. }
  10. type DummieExecutor struct{}
  11. func (this DummieExecutor) Execute(rule m.AlertRule, responseQueue chan *AlertResult) {
  12. //if rule.Id == 6 {
  13. // time.Sleep(time.Second * 60)
  14. //}
  15. time.Sleep(time.Second)
  16. log.Info("Finnished executing: %d", rule.Id)
  17. responseQueue <- &AlertResult{state: "OK", id: rule.Id}
  18. //return nil,
  19. }