AlertingNG: Split into several packages (#31719)
* AlertingNG: Split into several packages * Move AlertQuery to models
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package schedule
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||
)
|
||||
|
||||
func (sch *schedule) fetchAllDetails(now time.Time) []*models.AlertDefinition {
|
||||
q := models.ListAlertDefinitionsQuery{}
|
||||
err := sch.store.GetAlertDefinitions(&q)
|
||||
if err != nil {
|
||||
sch.log.Error("failed to fetch alert definitions", "now", now, "err", err)
|
||||
return nil
|
||||
}
|
||||
return q.Result
|
||||
}
|
||||
Reference in New Issue
Block a user