##// END OF EJS Templates
auth: update logging for permission calculation function
marcink -
r2813:fc1dc788 default
parent child Browse files
Show More
@@ -23,6 +23,7 b' authentication and permission libraries'
23 """
23 """
24
24
25 import os
25 import os
26 import time
26 import inspect
27 import inspect
27 import collections
28 import collections
28 import fnmatch
29 import fnmatch
@@ -1074,9 +1075,9 b' class AuthUser(object):'
1074 rhodecode.CONFIG.get('beaker.cache.short_term.expire'))
1075 rhodecode.CONFIG.get('beaker.cache.short_term.expire'))
1075 cache_on = cache or cache_seconds > 0
1076 cache_on = cache or cache_seconds > 0
1076 log.debug(
1077 log.debug(
1077 'Computing PERMISSION tree for scope `%s` with caching: %s' % (
1078 'Computing PERMISSION tree for user %s scope `%s` '
1078 scope, cache_on))
1079 'with caching: %s[%ss]' % (user, scope, cache_on, cache_seconds))
1079
1080 start = time.time()
1080 compute = caches.conditional_cache(
1081 compute = caches.conditional_cache(
1081 'short_term', 'cache_desc',
1082 'short_term', 'cache_desc',
1082 condition=cache_on, func=_cached_perms_data)
1083 condition=cache_on, func=_cached_perms_data)
@@ -1087,8 +1088,9 b' class AuthUser(object):'
1087 result_repr = []
1088 result_repr = []
1088 for k in result:
1089 for k in result:
1089 result_repr.append((k, len(result[k])))
1090 result_repr.append((k, len(result[k])))
1090
1091 total = time.time() - start
1091 log.debug('PERMISSION tree computed %s' % (result_repr,))
1092 log.debug('PERMISSION tree for user %s computed in %.3fs: %s' % (
1093 user, total, result_repr))
1092 return result
1094 return result
1093
1095
1094 @property
1096 @property
General Comments 0
You need to be logged in to leave comments. Login now