mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dispatch with context where missing (#40810)
This commit is contained in:
parent
53b283ee01
commit
67449b95e9
@ -659,7 +659,7 @@ func (hs *HTTPServer) RestoreDashboardVersion(c *models.ReqContext, apiCmd dtos.
|
||||
|
||||
func GetDashboardTags(c *models.ReqContext) {
|
||||
query := models.GetDashboardTagsQuery{OrgId: c.OrgId}
|
||||
err := bus.Dispatch(&query)
|
||||
err := bus.DispatchCtx(c.Req.Context(), &query)
|
||||
if err != nil {
|
||||
c.JsonApiErr(500, "Failed to get tags from database", err)
|
||||
return
|
||||
|
@ -127,7 +127,7 @@ func (srv *CleanUpService) shouldCleanupTempFile(filemtime time.Time, now time.T
|
||||
|
||||
func (srv *CleanUpService) deleteExpiredSnapshots() {
|
||||
cmd := models.DeleteExpiredSnapshotsCommand{}
|
||||
if err := bus.Dispatch(&cmd); err != nil {
|
||||
if err := bus.DispatchCtx(context.TODO(), &cmd); err != nil {
|
||||
srv.log.Error("Failed to delete expired snapshots", "error", err.Error())
|
||||
} else {
|
||||
srv.log.Debug("Deleted expired snapshots", "rows affected", cmd.DeletedRows)
|
||||
|
@ -1,6 +1,7 @@
|
||||
package search
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sort"
|
||||
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
@ -83,7 +84,7 @@ func (s *SearchService) searchHandler(query *Query) error {
|
||||
dashboardQuery.Sort = sortOpt
|
||||
}
|
||||
|
||||
if err := bus.Dispatch(&dashboardQuery); err != nil {
|
||||
if err := bus.DispatchCtx(context.TODO(), &dashboardQuery); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -119,7 +120,7 @@ func setStarredDashboards(userID int64, hits []*Hit) error {
|
||||
UserId: userID,
|
||||
}
|
||||
|
||||
if err := bus.Dispatch(&query); err != nil {
|
||||
if err := bus.DispatchCtx(context.TODO(), &query); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user