dataproxy: added caching of datasources when doing data proxy requests, #9078

This commit is contained in:
Torkel Ödegaard
2017-08-23 13:31:26 +02:00
parent bcb3dfac9f
commit 4f9fbcc211
12 changed files with 155 additions and 107 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/components/securejsondata"
"github.com/grafana/grafana/pkg/metrics"
m "github.com/grafana/grafana/pkg/models"
)
@@ -19,6 +20,8 @@ func init() {
}
func GetDataSourceById(query *m.GetDataSourceByIdQuery) error {
metrics.M_DB_DataSource_QueryById.Inc(1)
datasource := m.DataSource{OrgId: query.OrgId, Id: query.Id}
has, err := x.Get(&datasource)