mirror of
https://github.com/grafana/grafana.git
synced 2026-08-18 17:15:08 -05:00
Rendering service - add optional RenderingSession (#44098)
* rendering service changes: - make node-renderer request timeout configurable - introduce optional RenderingSession providing a long-lived session key * remove console logs * added comment explaining empty "afterRequest" method * fix compilation error * update imports formatting * Update pkg/services/rendering/interface.go Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update pkg/services/rendering/rendering.go Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * review fix: extract renderKey related functions/structs to auth.go * #44449: private'd `rendering.getRequestTimeout` Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
This commit is contained in:
co-authored by
Agnès Toulet
parent
3c334cd8ba
commit
5148250366
@@ -139,9 +139,15 @@ func (r *simpleCrawler) Start(c *models.ReqContext, mode CrawlerMode, theme rend
|
||||
|
||||
r.mode = mode
|
||||
r.opts = rendering.Opts{
|
||||
OrgID: c.OrgId,
|
||||
UserID: c.UserId,
|
||||
OrgRole: c.OrgRole,
|
||||
AuthOpts: rendering.AuthOpts{
|
||||
OrgID: c.OrgId,
|
||||
UserID: c.UserId,
|
||||
OrgRole: c.OrgRole,
|
||||
},
|
||||
TimeoutOpts: rendering.TimeoutOpts{
|
||||
Timeout: 10 * time.Second,
|
||||
RequestTimeoutMultiplier: 3,
|
||||
},
|
||||
Theme: theme,
|
||||
ConcurrentLimit: 10,
|
||||
}
|
||||
@@ -204,14 +210,11 @@ func (r *simpleCrawler) walk() {
|
||||
Width: 320,
|
||||
Height: 240,
|
||||
Path: panelURL,
|
||||
OrgID: r.opts.OrgID,
|
||||
UserID: r.opts.UserID,
|
||||
ConcurrentLimit: r.opts.ConcurrentLimit,
|
||||
OrgRole: r.opts.OrgRole,
|
||||
AuthOpts: r.opts.AuthOpts,
|
||||
TimeoutOpts: r.opts.TimeoutOpts,
|
||||
Theme: r.opts.Theme,
|
||||
Timeout: 10 * time.Second,
|
||||
DeviceScaleFactor: -5, // negative numbers will render larger then scale down
|
||||
})
|
||||
}, nil)
|
||||
if err != nil {
|
||||
tlog.Warn("error getting image", "err", err)
|
||||
r.status.Errors++
|
||||
|
||||
Reference in New Issue
Block a user