[Chore] Remove health check that is not used (#61283)

This commit is contained in:
ying-jeanne 2023-01-11 22:07:28 +08:00 committed by GitHub
parent 19ca93d5ce
commit 6c6a970f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 44 deletions

View File

@ -1,3 +0,0 @@
package models
type GetDBHealthQuery struct{}

View File

@ -1,16 +0,0 @@
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 ss.WithDbSession(ctx, func(session *DBSession) error {
_, err := session.Exec("SELECT 1")
return err
})
}

View File

@ -1,21 +0,0 @@
package sqlstore
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/models"
)
func TestIntegrationGetDBHealthQuery(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
store := InitTestDB(t)
query := models.GetDBHealthQuery{}
err := store.GetDBHealthQuery(context.Background(), &query)
require.NoError(t, err)
}

View File

@ -116,10 +116,6 @@ func (m *SQLStoreMock) Quote(value string) string {
return ""
}
func (m *SQLStoreMock) GetDBHealthQuery(ctx context.Context, query *models.GetDBHealthQuery) error {
return m.ExpectedError
}
func (m *SQLStoreMock) GetSqlxSession() *session.SessionDB {
return nil
}