##// END OF EJS Templates
caches: skip cache if user is empty.
marcink -
r2847:89242b5a default
parent child Browse files
Show More
@@ -694,7 +694,9 b' def authenticate(username, password, env'
694 log.debug('AUTH_CACHE_TTL for plugin `%s` active: %s (TTL: %s)',
694 log.debug('AUTH_CACHE_TTL for plugin `%s` active: %s (TTL: %s)',
695 plugin.get_id(), plugin_cache_active, cache_ttl)
695 plugin.get_id(), plugin_cache_active, cache_ttl)
696
696
697 user_id = user.user_id
697 user_id = user.user_id if user else None
698 # don't cache for empty users
699 plugin_cache_active = plugin_cache_active and user_id
698 cache_namespace_uid = 'cache_user_auth.{}'.format(user_id)
700 cache_namespace_uid = 'cache_user_auth.{}'.format(user_id)
699 region = rc_cache.get_or_create_region('cache_perms', cache_namespace_uid)
701 region = rc_cache.get_or_create_region('cache_perms', cache_namespace_uid)
700
702
General Comments 0
You need to be logged in to leave comments. Login now