mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
* remove bus from health api * fix health api tests * use db health query as a method * use pointer in sqlstore mock
17 lines
383 B
Go
17 lines
383 B
Go
package sqlstore
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
// GetDBHealthQuery executes a query to check
|
|
// the availability of the database.
|
|
func (ss *SQLStore) GetDBHealthQuery(ctx context.Context, query *models.GetDBHealthQuery) error {
|
|
return withDbSession(ctx, x, func(session *DBSession) error {
|
|
_, err := session.Exec("SELECT 1")
|
|
return err
|
|
})
|
|
}
|