mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 03:34:15 -06:00
c9f25cf0a5
Signed-off-by: bergquist <carl.bergquist@gmail.com>
22 lines
467 B
Go
22 lines
467 B
Go
package sqlstore
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/bus"
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
func init() {
|
|
bus.AddHandlerCtx("sql", GetDBHealthQuery)
|
|
}
|
|
|
|
// GetDBHealthQuery executes a query to check
|
|
// the availability of the database.
|
|
func GetDBHealthQuery(ctx context.Context, query *models.GetDBHealthQuery) error {
|
|
return withDbSession(ctx, x, func(session *DBSession) error {
|
|
_, err := session.Exec("SELECT 1")
|
|
return err
|
|
})
|
|
}
|