Commit 303cd8a5 by fg2it Committed by Torkel Ödegaard

[RenderToPng fix] (#4901)

* removing useless code

* fix various minor typo

* don't silence phantomjs timeout and allow more time

* fix gofmt
parent 543d247a
...@@ -88,7 +88,6 @@ go get github.com/grafana/grafana ...@@ -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)
......
...@@ -136,7 +136,7 @@ func readVersionFromPackageJson() { ...@@ -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 ...@@ -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 ...@@ -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) { ...@@ -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)
......
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) { ...@@ -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) { ...@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment