Reporting: Handle timeouts in rendering (#20415)

* Added timeout in grpc call to plugins for rendering
This commit is contained in:
Jon Gyllenswärd
2019-11-18 16:58:15 +01:00
committed by GitHub
parent e7e416cf8a
commit 7a8c6a9b54
4 changed files with 20 additions and 5 deletions

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 {