* Renderer: add version information
* fix alerting test
(cherry picked from commit 5f6c172b5a)
Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
This commit is contained in:
co-authored by
Agnès Toulet
parent
e3ffea3f1b
commit
da8d9e6854
@@ -47,6 +47,7 @@ type RenderingService struct {
|
||||
renderCSVAction renderCSVFunc
|
||||
domain string
|
||||
inProgressCount int
|
||||
version string
|
||||
|
||||
Cfg *setting.Cfg `inject:""`
|
||||
RemoteCacheService *remotecache.RemoteCache `inject:""`
|
||||
@@ -86,7 +87,14 @@ func (rs *RenderingService) Init() error {
|
||||
func (rs *RenderingService) Run(ctx context.Context) error {
|
||||
if rs.remoteAvailable() {
|
||||
rs.log = rs.log.New("renderer", "http")
|
||||
rs.log.Info("Backend rendering via external http server")
|
||||
|
||||
version, err := rs.getRemotePluginVersion()
|
||||
if err != nil {
|
||||
rs.log.Info("Couldn't get remote renderer version", "err", err)
|
||||
}
|
||||
|
||||
rs.log.Info("Backend rendering via external http server", "version", version)
|
||||
rs.version = version
|
||||
rs.renderAction = rs.renderViaHTTP
|
||||
rs.renderCSVAction = rs.renderCSVViaHTTP
|
||||
<-ctx.Done()
|
||||
@@ -101,6 +109,7 @@ func (rs *RenderingService) Run(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
rs.version = rs.pluginInfo.Info.Version
|
||||
rs.renderAction = rs.renderViaPlugin
|
||||
rs.renderCSVAction = rs.renderCSVViaPlugin
|
||||
<-ctx.Done()
|
||||
@@ -127,6 +136,10 @@ func (rs *RenderingService) IsAvailable() bool {
|
||||
return rs.remoteAvailable() || rs.pluginAvailable()
|
||||
}
|
||||
|
||||
func (rs *RenderingService) Version() string {
|
||||
return rs.version
|
||||
}
|
||||
|
||||
func (rs *RenderingService) RenderErrorImage(err error) (*RenderResult, error) {
|
||||
imgUrl := "public/img/rendering_error.png"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user