Rendering: Store render key in remote cache (#22031)
By storing render key in remote cache it will enable image renderer to use public facing url or load balancer url to render images and thereby remove the requirement of image renderer having to use the url of the originating Grafana instance when running HA setup (multiple Grafana instances). Fixes #17704 Ref grafana/grafana-image-renderer#91
This commit is contained in:
@@ -12,17 +12,12 @@ func (rs *RenderingService) startPlugin(ctx context.Context) error {
|
||||
return rs.pluginInfo.Start(ctx)
|
||||
}
|
||||
|
||||
func (rs *RenderingService) renderViaPlugin(ctx context.Context, opts Opts) (*RenderResult, error) {
|
||||
func (rs *RenderingService) renderViaPlugin(ctx context.Context, renderKey string, opts Opts) (*RenderResult, error) {
|
||||
pngPath, err := rs.getFilePathForNewImage()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
renderKey, err := rs.getRenderKey(opts.OrgId, opts.UserId, opts.OrgRole)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// gives plugin some additional time to timeout and return possible errors.
|
||||
ctx, cancel := context.WithTimeout(ctx, opts.Timeout+time.Second*2)
|
||||
defer cancel()
|
||||
|
||||
Reference in New Issue
Block a user