# HG changeset patch # User Marcin Kuzminski # Date 2018-07-06 12:47:09 # Node ID 89242b5a9207dd70e800f91cd160d0fe21f81f29 # Parent bbc9660298ec319399342e08f2974e93b42486d2 caches: skip cache if user is empty. diff --git a/rhodecode/authentication/base.py b/rhodecode/authentication/base.py --- a/rhodecode/authentication/base.py +++ b/rhodecode/authentication/base.py @@ -694,7 +694,9 @@ def authenticate(username, password, env log.debug('AUTH_CACHE_TTL for plugin `%s` active: %s (TTL: %s)', plugin.get_id(), plugin_cache_active, cache_ttl) - user_id = user.user_id + user_id = user.user_id if user else None + # don't cache for empty users + plugin_cache_active = plugin_cache_active and user_id cache_namespace_uid = 'cache_user_auth.{}'.format(user_id) region = rc_cache.get_or_create_region('cache_perms', cache_namespace_uid)