mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Previews: prevent scheduler from running when image renderer is outdated (#45623)
* #44449: prevent crawler from running when rendering service is outdated * #44449: simplify
This commit is contained in:
parent
7643ae6c5e
commit
c04b0179ff
@ -3,6 +3,7 @@ package thumbs
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
@ -83,6 +84,16 @@ func (r *simpleCrawler) broadcastStatus() {
|
||||
}
|
||||
|
||||
func (r *simpleCrawler) Run(ctx context.Context, authOpts rendering.AuthOpts, mode CrawlerMode, theme models.Theme, thumbnailKind models.ThumbnailKind) error {
|
||||
res, err := r.renderService.HasCapability(rendering.ScalingDownImages)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !res.IsSupported {
|
||||
return fmt.Errorf("cant run dashboard crawler - rendering service needs to be updated. "+
|
||||
"current version: %s, requiredVersion: %s", r.renderService.Version(), res.SemverConstraint)
|
||||
}
|
||||
|
||||
r.queueMutex.Lock()
|
||||
if r.IsRunning() {
|
||||
r.queueMutex.Unlock()
|
||||
|
Loading…
Reference in New Issue
Block a user