mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
[RenderToPng fix] (#4901)
* removing useless code * fix various minor typo * don't silence phantomjs timeout and allow more time * fix gofmt
This commit is contained in:
parent
543d247af8
commit
303cd8a5af
@ -88,7 +88,6 @@ go get github.com/grafana/grafana
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Building the backend
|
### Building the backend
|
||||||
Replace X.Y.Z by actual version number.
|
|
||||||
```bash
|
```bash
|
||||||
cd $GOPATH/src/github.com/grafana/grafana
|
cd $GOPATH/src/github.com/grafana/grafana
|
||||||
go run build.go setup (only needed once to install godep)
|
go run build.go setup (only needed once to install godep)
|
||||||
|
2
build.go
2
build.go
@ -136,7 +136,7 @@ func readVersionFromPackageJson() {
|
|||||||
// add timestamp to iteration
|
// add timestamp to iteration
|
||||||
linuxPackageIteration = fmt.Sprintf("%s%v", linuxPackageIteration, time.Now().Unix())
|
linuxPackageIteration = fmt.Sprintf("%s%v", linuxPackageIteration, time.Now().Unix())
|
||||||
}
|
}
|
||||||
log.Println(fmt.Sprintf("teration %v", linuxPackageIteration))
|
log.Println(fmt.Sprintf("Iteration %v", linuxPackageIteration))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ mode = console, file
|
|||||||
# Buffer length of channel, keep it as it is if you don't know what it is.
|
# Buffer length of channel, keep it as it is if you don't know what it is.
|
||||||
buffer_len = 10000
|
buffer_len = 10000
|
||||||
|
|
||||||
# Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
|
# Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Info"
|
||||||
level = Info
|
level = Info
|
||||||
|
|
||||||
# For "console" mode only
|
# For "console" mode only
|
||||||
|
@ -230,7 +230,7 @@ check_for_updates = true
|
|||||||
# Buffer length of channel, keep it as it is if you don't know what it is.
|
# Buffer length of channel, keep it as it is if you don't know what it is.
|
||||||
;buffer_len = 10000
|
;buffer_len = 10000
|
||||||
|
|
||||||
# Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
|
# Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Info"
|
||||||
;level = Info
|
;level = Info
|
||||||
|
|
||||||
# For "console" mode only
|
# For "console" mode only
|
||||||
|
@ -31,7 +31,7 @@ func RenderToPng(c *middleware.Context) {
|
|||||||
Width: queryReader.Get("width", "800"),
|
Width: queryReader.Get("width", "800"),
|
||||||
Height: queryReader.Get("height", "400"),
|
Height: queryReader.Get("height", "400"),
|
||||||
SessionId: c.Session.ID(),
|
SessionId: c.Session.ID(),
|
||||||
Timeout: queryReader.Get("timeout", "15"),
|
Timeout: queryReader.Get("timeout", "30"),
|
||||||
}
|
}
|
||||||
|
|
||||||
renderOpts.Url = setting.ToAbsUrl(renderOpts.Url)
|
renderOpts.Url = setting.ToAbsUrl(renderOpts.Url)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package renderer
|
package renderer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
@ -72,6 +73,7 @@ func RenderToPng(params *RenderOpts) (string, error) {
|
|||||||
if err := cmd.Process.Kill(); err != nil {
|
if err := cmd.Process.Kill(); err != nil {
|
||||||
log.Error(4, "failed to kill: %v", err)
|
log.Error(4, "failed to kill: %v", err)
|
||||||
}
|
}
|
||||||
|
return "", fmt.Errorf("PhantomRenderer::renderToPng timeout (>%vs)", timeout)
|
||||||
case <-done:
|
case <-done:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,8 +15,6 @@ module.exports = function(config,grunt) {
|
|||||||
src = confDir+src;
|
src = confDir+src;
|
||||||
}
|
}
|
||||||
|
|
||||||
var exec = require('child_process').execFileSync;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
grunt.config('copy.phantom_bin', {
|
grunt.config('copy.phantom_bin', {
|
||||||
src: src,
|
src: src,
|
||||||
|
Loading…
Reference in New Issue
Block a user