# HG changeset patch # User Marcin Kuzminski # Date 2018-06-22 16:35:41 # Node ID 506cc0a8f71396c9564250396b84326ef8ee554f # Parent 45a75c508a9fad4c5a0977123a93049c9f30ff76 caches: switch other permission cache to use same cache region. diff --git a/rhodecode/lib/auth.py b/rhodecode/lib/auth.py --- a/rhodecode/lib/auth.py +++ b/rhodecode/lib/auth.py @@ -1154,7 +1154,7 @@ class AuthUser(object): RepoList(qry, perm_set=perm_def)] compute = caches.conditional_cache( - 'long_term', 'repo_acl_ids.{}'.format(self.user_id), + 'short_term', 'repo_acl_ids.{}'.format(self.user_id), condition=cache, func=_cached_repo_acl) return compute(self.user_id, perms, name_filter) @@ -1180,7 +1180,7 @@ class AuthUser(object): RepoGroupList(qry, perm_set=perm_def)] compute = caches.conditional_cache( - 'long_term', 'repo_group_acl_ids.{}'.format(self.user_id), + 'short_term', 'repo_group_acl_ids.{}'.format(self.user_id), condition=cache, func=_cached_repo_group_acl) return compute(self.user_id, perms, name_filter) @@ -1206,7 +1206,7 @@ class AuthUser(object): UserGroupList(qry, perm_set=perm_def)] compute = caches.conditional_cache( - 'long_term', 'user_group_acl_ids.{}'.format(self.user_id), + 'short_term', 'user_group_acl_ids.{}'.format(self.user_id), condition=cache, func=_cached_user_group_acl) return compute(self.user_id, perms, name_filter) diff --git a/rhodecode/lib/caches.py b/rhodecode/lib/caches.py --- a/rhodecode/lib/caches.py +++ b/rhodecode/lib/caches.py @@ -156,7 +156,7 @@ def conditional_cache(region, cache_name return data # depending on the condition the compute is wrapped in cache or not - compute = conditional_cache('short_term', 'cache_desc', + compute = conditional_cache('short_term', 'cache_namespace_id', condition=True, func=func) return compute(arg)