Chore: Remove bus from health api (#44897)

* remove bus from health api

* fix health api tests

* use db health query as a method

* use pointer in sqlstore mock
This commit is contained in:
Serge Zaitsev
2022-02-04 14:33:35 +01:00
committed by GitHub
parent 058e3ffc21
commit 61533a3cb4
7 changed files with 16 additions and 39 deletions

View File

@@ -4,7 +4,6 @@ import (
"context"
"time"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/models"
)
@@ -15,7 +14,7 @@ func (hs *HTTPServer) databaseHealthy(ctx context.Context) bool {
return cached.(bool)
}
healthy := bus.Dispatch(ctx, &models.GetDBHealthQuery{}) == nil
healthy := hs.SQLStore.GetDBHealthQuery(ctx, &models.GetDBHealthQuery{}) == nil
hs.CacheService.Set(cacheKey, healthy, time.Second*5)
return healthy