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
88bbc452
Unverified
Commit
88bbc452
authored
Sep 28, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: send and mark as complete
parent
1a75aa54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
pkg/models/alert_notifications.go
+3
-2
pkg/services/alerting/notifier.go
+18
-7
No files found.
pkg/models/alert_notifications.go
View file @
88bbc452
...
...
@@ -100,8 +100,9 @@ type SetAlertNotificationStateToPendingCommand struct {
}
type
SetAlertNotificationStateToCompleteCommand
struct
{
Id
int64
SentAt
int64
Id
int64
Version
int64
SentAt
int64
}
type
GetNotificationStateQuery
struct
{
...
...
pkg/services/alerting/notifier.go
View file @
88bbc452
...
...
@@ -3,6 +3,7 @@ package alerting
import
(
"errors"
"fmt"
"time"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/components/imguploader"
...
...
@@ -53,17 +54,27 @@ func (n *notificationService) SendIfNeeded(context *EvalContext) error {
}
}
// get alert notification (version = 1)
// phantomjs 15 sek
// loopa notifier - ge mig ett lås! where version = 1
// send notification
// Släpp lås
//
return
n
.
sendNotifications
(
context
,
notifierStates
)
}
func
(
n
*
notificationService
)
sendAndMarkAsComplete
(
evalContext
*
EvalContext
,
notifierState
*
NotifierState
)
error
{
err
:=
notifierState
.
notifier
.
Notify
(
evalContext
)
cmd
:=
&
m
.
SetAlertNotificationStateToCompleteCommand
{
Id
:
notifierState
.
state
.
Id
,
Version
:
notifierState
.
state
.
Version
,
SentAt
:
time
.
Now
()
.
Unix
(),
}
err
=
bus
.
DispatchCtx
(
evalContext
.
Ctx
,
cmd
)
if
err
==
m
.
ErrAlertNotificationStateVersionConflict
{
return
nil
}
if
err
!=
nil
{
return
err
}
return
nil
}
...
...
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