codestyle: moves cache to infra (#17519)

This commit is contained in:
Carl Bergquist
2019-06-13 10:55:38 +02:00
committed by GitHub
parent df917663e6
commit 6809d2bb29
5 changed files with 14 additions and 12 deletions

View File

@@ -13,11 +13,11 @@ import (
"github.com/go-sql-driver/mysql"
"github.com/go-xorm/xorm"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/infra/localcache"
"github.com/grafana/grafana/pkg/infra/log"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/registry"
"github.com/grafana/grafana/pkg/services/annotations"
"github.com/grafana/grafana/pkg/services/cache"
"github.com/grafana/grafana/pkg/services/sqlstore/migrations"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/services/sqlstore/sqlutil"
@@ -50,9 +50,9 @@ func init() {
}
type SqlStore struct {
Cfg *setting.Cfg `inject:""`
Bus bus.Bus `inject:""`
CacheService *cache.CacheService `inject:""`
Cfg *setting.Cfg `inject:""`
Bus bus.Bus `inject:""`
CacheService *localcache.CacheService `inject:""`
dbCfg DatabaseConfig
engine *xorm.Engine
@@ -296,7 +296,7 @@ func InitTestDB(t ITestDB) *SqlStore {
sqlstore := &SqlStore{}
sqlstore.skipEnsureAdmin = true
sqlstore.Bus = bus.New()
sqlstore.CacheService = cache.New(5*time.Minute, 10*time.Minute)
sqlstore.CacheService = localcache.New(5*time.Minute, 10*time.Minute)
dbType := migrator.SQLITE