##// END OF EJS Templates
caches: switch other permission cache to use same cache region.
marcink -
r2815:506cc0a8 default
parent child Browse files
Show More
@@ -1154,7 +1154,7 b' class AuthUser(object):'
1154 RepoList(qry, perm_set=perm_def)]
1154 RepoList(qry, perm_set=perm_def)]
1155
1155
1156 compute = caches.conditional_cache(
1156 compute = caches.conditional_cache(
1157 'long_term', 'repo_acl_ids.{}'.format(self.user_id),
1157 'short_term', 'repo_acl_ids.{}'.format(self.user_id),
1158 condition=cache, func=_cached_repo_acl)
1158 condition=cache, func=_cached_repo_acl)
1159 return compute(self.user_id, perms, name_filter)
1159 return compute(self.user_id, perms, name_filter)
1160
1160
@@ -1180,7 +1180,7 b' class AuthUser(object):'
1180 RepoGroupList(qry, perm_set=perm_def)]
1180 RepoGroupList(qry, perm_set=perm_def)]
1181
1181
1182 compute = caches.conditional_cache(
1182 compute = caches.conditional_cache(
1183 'long_term', 'repo_group_acl_ids.{}'.format(self.user_id),
1183 'short_term', 'repo_group_acl_ids.{}'.format(self.user_id),
1184 condition=cache, func=_cached_repo_group_acl)
1184 condition=cache, func=_cached_repo_group_acl)
1185 return compute(self.user_id, perms, name_filter)
1185 return compute(self.user_id, perms, name_filter)
1186
1186
@@ -1206,7 +1206,7 b' class AuthUser(object):'
1206 UserGroupList(qry, perm_set=perm_def)]
1206 UserGroupList(qry, perm_set=perm_def)]
1207
1207
1208 compute = caches.conditional_cache(
1208 compute = caches.conditional_cache(
1209 'long_term', 'user_group_acl_ids.{}'.format(self.user_id),
1209 'short_term', 'user_group_acl_ids.{}'.format(self.user_id),
1210 condition=cache, func=_cached_user_group_acl)
1210 condition=cache, func=_cached_user_group_acl)
1211 return compute(self.user_id, perms, name_filter)
1211 return compute(self.user_id, perms, name_filter)
1212
1212
@@ -156,7 +156,7 b' def conditional_cache(region, cache_name'
156 return data
156 return data
157
157
158 # depending on the condition the compute is wrapped in cache or not
158 # depending on the condition the compute is wrapped in cache or not
159 compute = conditional_cache('short_term', 'cache_desc',
159 compute = conditional_cache('short_term', 'cache_namespace_id',
160 condition=True, func=func)
160 condition=True, func=func)
161 return compute(arg)
161 return compute(arg)
162
162
General Comments 0
You need to be logged in to leave comments. Login now