AuthZ: Fix cacheHit computation (#112088)

* AuthZ: Fix cacheHit computation

* Remove the ok bool
This commit is contained in:
Gabriel MABILLE 2025-10-07 10:12:14 +02:00 committed by GitHub
parent 2c5ccd3283
commit 26e147d01f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -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)