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
84fea7c1
Commit
84fea7c1
authored
Feb 09, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioning: dont return error unless you want to cancel all operations
parent
5a766240
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
pkg/services/provisioning/dashboards/file_reader.go
+11
-7
No files found.
pkg/services/provisioning/dashboards/file_reader.go
View file @
84fea7c1
...
...
@@ -120,16 +120,15 @@ func (fr *fileReader) startWalkingDisk() error {
cmd
:=
&
models
.
DeleteDashboardCommand
{
OrgId
:
fr
.
Cfg
.
OrgId
,
Id
:
dashboardId
}
err
:=
bus
.
Dispatch
(
cmd
)
if
err
!=
nil
{
return
err
fr
.
log
.
Error
(
"failed to delete dashboard"
,
"id"
,
cmd
.
Id
)
}
}
//
insert/updat
e dashboards based on json files
//
sav
e dashboards based on json files
for
path
,
fileInfo
:=
range
filesFoundOnDisk
{
err
=
fr
.
saveDashboard
(
path
,
folderId
,
fileInfo
,
provisionedDashboardRefs
)
if
err
!=
nil
{
fr
.
log
.
Error
(
"Failed to save dashboard"
,
"error"
,
err
)
return
err
fr
.
log
.
Error
(
"failed to save dashboard"
,
"error"
,
err
)
}
}
...
...
@@ -142,8 +141,8 @@ func (fr *fileReader) saveDashboard(path string, folderId int64, fileInfo os.Fil
return
err
}
provisionedData
,
al
lR
eadyProvisioned
:=
provisionedDashboardRefs
[
path
]
if
al
lR
eadyProvisioned
&&
provisionedData
.
Updated
.
Unix
()
==
resolvedFileInfo
.
ModTime
()
.
Unix
()
{
provisionedData
,
al
r
eadyProvisioned
:=
provisionedDashboardRefs
[
path
]
if
al
r
eadyProvisioned
&&
provisionedData
.
Updated
.
Unix
()
==
resolvedFileInfo
.
ModTime
()
.
Unix
()
{
return
nil
// dashboard is already in sync with the database
}
...
...
@@ -153,7 +152,12 @@ func (fr *fileReader) saveDashboard(path string, folderId int64, fileInfo os.Fil
return
nil
}
if
allReadyProvisioned
{
if
dash
.
Dashboard
.
Id
!=
0
{
fr
.
log
.
Error
(
"provisioned dashboard json files cannot contain id"
)
return
nil
}
if
alreadyProvisioned
{
dash
.
Dashboard
.
SetId
(
provisionedData
.
DashboardId
)
}
...
...
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