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
6edae37a
Commit
6edae37a
authored
Jun 22, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(alerting): rename state response method
parent
403fdebc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
pkg/services/alerting/engine.go
+5
-8
No files found.
pkg/services/alerting/engine.go
View file @
6edae37a
...
...
@@ -121,20 +121,19 @@ func (e *Engine) resultHandler() {
result
.
State
=
alertstates
.
Critical
result
.
Description
=
fmt
.
Sprintf
(
"Failed to run check after %d retires, Error: %v"
,
maxAlertExecutionRetries
,
result
.
Error
)
e
.
save
State
(
result
)
e
.
reactTo
State
(
result
)
}
}
else
{
result
.
AlertJob
.
ResetRetry
()
e
.
save
State
(
result
)
e
.
reactTo
State
(
result
)
}
}
}
func
(
e
*
Engine
)
save
State
(
result
*
AlertResult
)
{
func
(
e
*
Engine
)
reactTo
State
(
result
*
AlertResult
)
{
query
:=
&
m
.
GetAlertByIdQuery
{
Id
:
result
.
AlertJob
.
Rule
.
Id
}
bus
.
Dispatch
(
query
)
e
.
notifier
.
Notify
(
result
)
if
query
.
Result
.
ShouldUpdateState
(
result
.
State
)
{
cmd
:=
&
m
.
UpdateAlertStateCommand
{
AlertId
:
result
.
AlertJob
.
Rule
.
Id
,
...
...
@@ -146,9 +145,7 @@ func (e *Engine) saveState(result *AlertResult) {
e
.
log
.
Error
(
"Failed to save state"
,
"error"
,
err
)
}
e
.
log
.
Debug
(
"will notify! about"
,
"new state"
,
result
.
State
)
}
else
{
e
.
log
.
Debug
(
"state remains the same!"
)
e
.
log
.
Debug
(
"will notify about new state"
,
"new state"
,
result
.
State
)
e
.
notifier
.
Notify
(
result
)
}
}
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