Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
2bf399d3
Unverified
Commit
2bf399d3
authored
Sep 28, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No need to get alert notification state in ShouldNotify
parent
69cc24ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
14 deletions
+1
-14
pkg/services/alerting/notifiers/base.go
+1
-14
No files found.
pkg/services/alerting/notifiers/base.go
View file @
2bf399d3
...
...
@@ -4,7 +4,6 @@ import (
"context"
"time"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/models"
...
...
@@ -69,19 +68,7 @@ func defaultShouldNotify(context *alerting.EvalContext, sendReminder bool, frequ
// ShouldNotify checks this evaluation should send an alert notification
func
(
n
*
NotifierBase
)
ShouldNotify
(
ctx
context
.
Context
,
c
*
alerting
.
EvalContext
,
notiferState
*
models
.
AlertNotificationState
)
bool
{
cmd
:=
&
models
.
GetNotificationStateQuery
{
OrgId
:
c
.
Rule
.
OrgId
,
AlertId
:
c
.
Rule
.
Id
,
NotifierId
:
n
.
Id
,
}
err
:=
bus
.
DispatchCtx
(
ctx
,
cmd
)
if
err
!=
nil
{
n
.
log
.
Error
(
"Could not determine last time alert notifier fired"
,
"Alert name"
,
c
.
Rule
.
Name
,
"Error"
,
err
)
return
false
}
return
defaultShouldNotify
(
c
,
n
.
SendReminder
,
n
.
Frequency
,
cmd
.
Result
)
return
defaultShouldNotify
(
c
,
n
.
SendReminder
,
n
.
Frequency
,
notiferState
)
}
func
(
n
*
NotifierBase
)
GetType
()
string
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment