mirror of https://github.com/grafana/grafana.git
AuthZ: Fix cacheHit computation (#112088)
* AuthZ: Fix cacheHit computation * Remove the ok bool
This commit is contained in:
parent
2c5ccd3283
commit
26e147d01f
|
@ -760,12 +760,10 @@ func (s *Service) listPermission(ctx context.Context, scopeMap map[string]bool,
|
||||||
cacheHit := false
|
cacheHit := false
|
||||||
if t.HasFolderSupport() {
|
if t.HasFolderSupport() {
|
||||||
var err error
|
var err error
|
||||||
ok = false
|
|
||||||
if !req.Options.SkipCache {
|
if !req.Options.SkipCache {
|
||||||
tree, ok = s.getCachedFolderTree(ctx, req.Namespace)
|
tree, cacheHit = s.getCachedFolderTree(ctx, req.Namespace)
|
||||||
cacheHit = true
|
|
||||||
}
|
}
|
||||||
if !ok {
|
if !cacheHit {
|
||||||
tree, err = s.buildFolderTree(ctx, req.Namespace)
|
tree, err = s.buildFolderTree(ctx, req.Namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctxLogger.Error("could not build folder and dashboard tree", "error", err)
|
ctxLogger.Error("could not build folder and dashboard tree", "error", err)
|
||||||
|
|
Loading…
Reference in New Issue