Rendering: Add support for rate limiter (#103987)

* Rendering: Add support for rate limiter

* remove unnecessary golint exception

* add lint exception back
This commit is contained in:
Agnès Toulet
2025-04-24 15:31:19 +02:00
committed by GitHub
parent f0c841b9bc
commit e7b800f35a
3 changed files with 12 additions and 0 deletions
+5
View File
@@ -98,6 +98,11 @@ func (hs *HTTPServer) RenderHandler(c *contextmodel.ReqContext) {
Theme: themeModel,
}, nil)
if err != nil {
if errors.Is(err, rendering.ErrTooManyRequests) {
c.JsonApiErr(http.StatusTooManyRequests, "Too many rendering requests", err)
return
}
if errors.Is(err, rendering.ErrTimeout) {
c.Handle(hs.Cfg, http.StatusInternalServerError, err.Error(), err)
return