From e1df51109eb5fd74e2689b33e831f2f9bf1a60ba Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Thu, 13 Jun 2019 12:15:52 +0200 Subject: [PATCH] Fix so that correct cache is provided to di registry (#17566) This fix prevents Grafana from crashing after being logged in. Ref #17519 --- pkg/cmd/grafana-server/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/grafana-server/server.go b/pkg/cmd/grafana-server/server.go index c1cf07bfee2..85d6db43ed2 100644 --- a/pkg/cmd/grafana-server/server.go +++ b/pkg/cmd/grafana-server/server.go @@ -12,13 +12,13 @@ import ( "time" "github.com/facebookgo/inject" - "github.com/patrickmn/go-cache" "golang.org/x/sync/errgroup" "github.com/grafana/grafana/pkg/api" "github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/bus" _ "github.com/grafana/grafana/pkg/extensions" + "github.com/grafana/grafana/pkg/infra/localcache" "github.com/grafana/grafana/pkg/infra/log" _ "github.com/grafana/grafana/pkg/infra/metrics" _ "github.com/grafana/grafana/pkg/infra/remotecache" @@ -88,7 +88,7 @@ func (g *GrafanaServerImpl) Run() error { if err != nil { return fmt.Errorf("Failed to provide object to the graph: %v", err) } - err = serviceGraph.Provide(&inject.Object{Value: cache.New(5*time.Minute, 10*time.Minute)}) + err = serviceGraph.Provide(&inject.Object{Value: localcache.New(5*time.Minute, 10*time.Minute)}) if err != nil { return fmt.Errorf("Failed to provide object to the graph: %v", err) }