mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user