Reporting: Handle timeouts in rendering (#20415)

* Added timeout in grpc call to plugins for rendering

(cherry picked from commit 7a8c6a9b54)
This commit is contained in:
Jon Gyllenswärd
2019-11-25 12:01:36 +01:00
committed by Marcus Efraimsson
parent 62b61f98cc
commit 64e294c586
4 changed files with 20 additions and 5 deletions
+2 -1
View File
@@ -40,6 +40,7 @@ func (hs *HTTPServer) RenderToPng(c *m.ReqContext) {
return
}
maxConcurrentLimitForApiCalls := 30
result, err := hs.RenderService.Render(c.Req.Context(), rendering.Opts{
Width: width,
Height: height,
@@ -50,7 +51,7 @@ func (hs *HTTPServer) RenderToPng(c *m.ReqContext) {
Path: c.Params("*") + queryParams,
Timezone: queryReader.Get("tz", ""),
Encoding: queryReader.Get("encoding", ""),
ConcurrentLimit: 30,
ConcurrentLimit: maxConcurrentLimitForApiCalls,
})
if err != nil && err == rendering.ErrTimeout {