summaryrefslogtreecommitdiffstats
path: root/store/local_cache_supplier_roles.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-02-07 18:15:07 +0000
committerGitHub <noreply@github.com>2018-02-07 18:15:07 +0000
commita735725d116c3e8dca2b4d1cad3425bcd473311c (patch)
tree7253153de1bbdc8ede107c7c93e90c3ce2b2afe9 /store/local_cache_supplier_roles.go
parenta04b02081a77497ecfc7a5ae9ffb0ca28404dd0e (diff)
downloadchat-a735725d116c3e8dca2b4d1cad3425bcd473311c.tar.gz
chat-a735725d116c3e8dca2b4d1cad3425bcd473311c.tar.bz2
chat-a735725d116c3e8dca2b4d1cad3425bcd473311c.zip
XYZ-59: Implement redis caching layer for Role store. (#8207)
* XYZ-59: Implement redis caching layer for Role store. * Use variable for key where used more than once.
Diffstat (limited to 'store/local_cache_supplier_roles.go')
-rw-r--r--store/local_cache_supplier_roles.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/store/local_cache_supplier_roles.go b/store/local_cache_supplier_roles.go
index a9cbda017..8cbde0a23 100644
--- a/store/local_cache_supplier_roles.go
+++ b/store/local_cache_supplier_roles.go
@@ -25,6 +25,8 @@ func (s *LocalCacheSupplier) RoleSave(ctx context.Context, role *model.Role, hin
}
func (s *LocalCacheSupplier) RoleGet(ctx context.Context, roleId string, hints ...LayeredStoreHint) *LayeredStoreSupplierResult {
+ // Roles are cached by name, as that is most commonly how they are looked up.
+ // This means that no caching is supported on roles being looked up by ID.
return s.Next().RoleGet(ctx, roleId, hints...)
}