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
1dfa5299
Commit
1dfa5299
authored
Dec 05, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboards as cfg: avoid walking fs in parallel
parent
b28ea0b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
pkg/services/provisioning/dashboards/file_reader.go
+10
-2
No files found.
pkg/services/provisioning/dashboards/file_reader.go
View file @
1dfa5299
...
...
@@ -64,16 +64,24 @@ func (fr *fileReader) getCache(key string) (*dashboards.SaveDashboardItem, bool)
}
func
(
fr
*
fileReader
)
ReadAndListen
(
ctx
context
.
Context
)
error
{
ticker
:=
time
.
NewTicker
(
time
.
Second
*
5
)
ticker
:=
time
.
NewTicker
(
time
.
Second
*
3
)
if
err
:=
fr
.
walkFolder
();
err
!=
nil
{
fr
.
log
.
Error
(
"failed to search for dashboards"
,
"error"
,
err
)
}
running
:=
false
for
{
select
{
case
<-
ticker
.
C
:
fr
.
walkFolder
()
if
!
running
{
// avoid walking the filesystem in parallel. incase fs is very slow.
running
=
true
go
func
()
{
fr
.
walkFolder
()
running
=
false
}()
}
case
<-
ctx
.
Done
()
:
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