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
1b38d945
Unverified
Commit
1b38d945
authored
Nov 20, 2019
by
Jon Gyllenswärd
Committed by
GitHub
Nov 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Image-rendering: Cleanup of rendering code (#20496)
parent
432f3602
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
pkg/services/rendering/interface.go
+1
-2
pkg/services/rendering/rendering.go
+2
-4
No files found.
pkg/services/rendering/interface.go
View file @
1b38d945
...
@@ -26,8 +26,7 @@ type Opts struct {
...
@@ -26,8 +26,7 @@ type Opts struct {
}
}
type
RenderResult
struct
{
type
RenderResult
struct
{
FilePath
string
FilePath
string
KeepFileAfterRender
bool
}
}
type
renderFunc
func
(
ctx
context
.
Context
,
options
Opts
)
(
*
RenderResult
,
error
)
type
renderFunc
func
(
ctx
context
.
Context
,
options
Opts
)
(
*
RenderResult
,
error
)
...
...
pkg/services/rendering/rendering.go
View file @
1b38d945
...
@@ -96,16 +96,14 @@ func (rs *RenderingService) RenderErrorImage(err error) (*RenderResult, error) {
...
@@ -96,16 +96,14 @@ func (rs *RenderingService) RenderErrorImage(err error) (*RenderResult, error) {
imgUrl
:=
"public/img/rendering_error.png"
imgUrl
:=
"public/img/rendering_error.png"
return
&
RenderResult
{
return
&
RenderResult
{
FilePath
:
filepath
.
Join
(
setting
.
HomePath
,
imgUrl
),
FilePath
:
filepath
.
Join
(
setting
.
HomePath
,
imgUrl
),
KeepFileAfterRender
:
true
,
},
nil
},
nil
}
}
func
(
rs
*
RenderingService
)
Render
(
ctx
context
.
Context
,
opts
Opts
)
(
*
RenderResult
,
error
)
{
func
(
rs
*
RenderingService
)
Render
(
ctx
context
.
Context
,
opts
Opts
)
(
*
RenderResult
,
error
)
{
if
rs
.
inProgressCount
>
opts
.
ConcurrentLimit
{
if
rs
.
inProgressCount
>
opts
.
ConcurrentLimit
{
return
&
RenderResult
{
return
&
RenderResult
{
FilePath
:
filepath
.
Join
(
setting
.
HomePath
,
"public/img/rendering_limit.png"
),
FilePath
:
filepath
.
Join
(
setting
.
HomePath
,
"public/img/rendering_limit.png"
),
KeepFileAfterRender
:
true
,
},
nil
},
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