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
7b781e4c
Commit
7b781e4c
authored
Oct 02, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use notification state id instead of notifier id
parent
9289cba6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
pkg/services/alerting/notifier.go
+3
-3
pkg/services/sqlstore/alert_notification.go
+1
-1
No files found.
pkg/services/alerting/notifier.go
View file @
7b781e4c
...
...
@@ -74,7 +74,7 @@ func (n *notificationService) sendAndMarkAsComplete(evalContext *EvalContext, no
}
cmd
:=
&
m
.
SetAlertNotificationStateToCompleteCommand
{
Id
:
notifier
.
GetNotifierId
()
,
Id
:
notifier
State
.
state
.
Id
,
Version
:
notifierState
.
state
.
Version
,
}
...
...
@@ -84,7 +84,7 @@ func (n *notificationService) sendAndMarkAsComplete(evalContext *EvalContext, no
func
(
n
*
notificationService
)
sendNotification
(
evalContext
*
EvalContext
,
notifierState
*
notifierState
)
error
{
if
!
evalContext
.
IsTestRun
{
setPendingCmd
:=
&
m
.
SetAlertNotificationStateToPendingCommand
{
Id
:
notifierState
.
state
.
Notifier
Id
,
Id
:
notifierState
.
state
.
Id
,
Version
:
notifierState
.
state
.
Version
,
AlertRuleStateUpdatedVersion
:
evalContext
.
Rule
.
StateChanges
,
}
...
...
@@ -110,7 +110,7 @@ func (n *notificationService) sendNotifications(evalContext *EvalContext, notifi
for
_
,
notifierState
:=
range
notifierStates
{
err
:=
n
.
sendNotification
(
evalContext
,
notifierState
)
if
err
!=
nil
{
n
.
log
.
Error
(
"failed to send notification"
,
"id"
,
notifierState
.
notifier
.
GetNotifierId
())
n
.
log
.
Error
(
"failed to send notification"
,
"id"
,
notifierState
.
notifier
.
GetNotifierId
()
,
"error"
,
err
)
}
}
...
...
pkg/services/sqlstore/alert_notification.go
View file @
7b781e4c
...
...
@@ -238,7 +238,7 @@ func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {
}
func
SetAlertNotificationStateToCompleteCommand
(
ctx
context
.
Context
,
cmd
*
m
.
SetAlertNotificationStateToCompleteCommand
)
error
{
return
withDbSession
(
ctx
,
func
(
sess
*
DBSession
)
error
{
return
inTransactionCtx
(
ctx
,
func
(
sess
*
DBSession
)
error
{
version
:=
cmd
.
Version
var
current
m
.
AlertNotificationState
sess
.
ID
(
cmd
.
Id
)
.
Get
(
&
current
)
...
...
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