mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove bus from thumbs service (#46772)
This commit is contained in:
parent
5f67d78219
commit
df465ccad3
@ -9,7 +9,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/grafana/grafana/pkg/api/response"
|
"github.com/grafana/grafana/pkg/api/response"
|
||||||
"github.com/grafana/grafana/pkg/bus"
|
|
||||||
"github.com/grafana/grafana/pkg/infra/log"
|
"github.com/grafana/grafana/pkg/infra/log"
|
||||||
"github.com/grafana/grafana/pkg/infra/serverlock"
|
"github.com/grafana/grafana/pkg/infra/serverlock"
|
||||||
"github.com/grafana/grafana/pkg/models"
|
"github.com/grafana/grafana/pkg/models"
|
||||||
@ -46,6 +45,7 @@ type thumbService struct {
|
|||||||
thumbnailRepo thumbnailRepo
|
thumbnailRepo thumbnailRepo
|
||||||
lockService *serverlock.ServerLockService
|
lockService *serverlock.ServerLockService
|
||||||
features featuremgmt.FeatureToggles
|
features featuremgmt.FeatureToggles
|
||||||
|
store sqlstore.Store
|
||||||
crawlLockServiceActionName string
|
crawlLockServiceActionName string
|
||||||
log log.Logger
|
log log.Logger
|
||||||
}
|
}
|
||||||
@ -76,6 +76,7 @@ func ProvideService(cfg *setting.Cfg, features featuremgmt.FeatureToggles, lockS
|
|||||||
renderingService: renderService,
|
renderingService: renderService,
|
||||||
renderer: newSimpleCrawler(renderService, gl, thumbnailRepo),
|
renderer: newSimpleCrawler(renderService, gl, thumbnailRepo),
|
||||||
thumbnailRepo: thumbnailRepo,
|
thumbnailRepo: thumbnailRepo,
|
||||||
|
store: store,
|
||||||
features: features,
|
features: features,
|
||||||
lockService: lockService,
|
lockService: lockService,
|
||||||
crawlLockServiceActionName: "dashboard-crawler",
|
crawlLockServiceActionName: "dashboard-crawler",
|
||||||
@ -362,7 +363,7 @@ func (hs *thumbService) getStatus(c *models.ReqContext, uid string, checkSave bo
|
|||||||
func (hs *thumbService) getDashboardId(c *models.ReqContext, uid string) (int64, error) {
|
func (hs *thumbService) getDashboardId(c *models.ReqContext, uid string) (int64, error) {
|
||||||
query := models.GetDashboardQuery{Uid: uid, OrgId: c.OrgId}
|
query := models.GetDashboardQuery{Uid: uid, OrgId: c.OrgId}
|
||||||
|
|
||||||
if err := bus.Dispatch(c.Req.Context(), &query); err != nil {
|
if err := hs.store.GetDashboard(c.Req.Context(), &query); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user