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
991539e4
Commit
991539e4
authored
Sep 28, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(go_routines): improve variable naming
parent
34b31aee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
pkg/cmd/grafana-server/main.go
+3
-3
pkg/services/alerting/engine.go
+7
-4
No files found.
pkg/cmd/grafana-server/main.go
View file @
991539e4
...
...
@@ -60,10 +60,10 @@ func main() {
setting
.
BuildCommit
=
commit
setting
.
BuildStamp
=
buildstampInt64
appContext
,
cancel
Fn
:=
context
.
WithCancel
(
context
.
Background
())
grafanaGroup
,
_
:=
errgroup
.
WithContext
(
appContext
)
appContext
,
shutdown
Fn
:=
context
.
WithCancel
(
context
.
Background
())
grafanaGroup
,
appContext
:=
errgroup
.
WithContext
(
appContext
)
go
listenToSystemSignals
(
cancel
Fn
,
grafanaGroup
)
go
listenToSystemSignals
(
shutdown
Fn
,
grafanaGroup
)
flag
.
Parse
()
writePIDFile
()
...
...
pkg/services/alerting/engine.go
View file @
991539e4
...
...
@@ -39,7 +39,7 @@ func NewEngine() *Engine {
func
(
e
*
Engine
)
Start
(
grafanaCtx
context
.
Context
)
error
{
e
.
log
.
Info
(
"Starting Alerting Engine"
)
g
,
_
:=
errgroup
.
WithContext
(
grafanaCtx
)
g
,
grafanaCtx
:=
errgroup
.
WithContext
(
grafanaCtx
)
g
.
Go
(
func
()
error
{
return
e
.
alertingTicker
(
grafanaCtx
)
})
g
.
Go
(
func
()
error
{
return
e
.
execDispatcher
(
grafanaCtx
)
})
...
...
@@ -90,7 +90,7 @@ func (e *Engine) execDispatcher(grafanaCtx context.Context) error {
}
}
func
(
e
*
Engine
)
executeJob
(
grafanaCtx
context
.
Context
,
job
*
Job
)
{
func
(
e
*
Engine
)
executeJob
(
grafanaCtx
context
.
Context
,
job
*
Job
)
error
{
defer
func
()
{
if
err
:=
recover
();
err
!=
nil
{
e
.
log
.
Error
(
"Execute Alert Panic"
,
"error"
,
err
,
"stack"
,
log
.
Stack
(
1
))
...
...
@@ -108,11 +108,14 @@ func (e *Engine) executeJob(grafanaCtx context.Context, job *Job) {
}()
select
{
case
<-
grafanaCtx
.
Done
()
:
return
grafanaCtx
.
Err
()
case
evalContext
:=
<-
done
:
e
.
resultQueue
<-
evalContext
case
<-
grafanaCtx
.
Done
()
:
}
return
nil
}
func
(
e
*
Engine
)
resultDispatcher
(
grafanaCtx
context
.
Context
)
error
{
...
...
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