mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
Fix buggy key computation in cache_with_key.
The refactoring to use the cache_get() method incorrectly didn't remove the addition of KEY_PREFIX inside cache_with_key. The result was that the KEY_PREFIX was being added twice, once by cache_with_key and again inside cache_get. This had the impact of causing pointer saves to not take effect, because our attempts to update the memcached cache when we save the UserProfile object were using the correct cache key, but the actual code reading values out of the caceh wasn't. (imported from commit dcea000833f00622bdc0249488de3b186a7417b2)
This commit is contained in:
@@ -79,7 +79,7 @@ def cache_with_key(keyfunc, cache_name=None, timeout=None, with_statsd_key=None)
|
||||
def decorator(func):
|
||||
@wraps(func)
|
||||
def func_with_caching(*args, **kwargs):
|
||||
key = KEY_PREFIX + keyfunc(*args, **kwargs)
|
||||
key = keyfunc(*args, **kwargs)
|
||||
|
||||
val = cache_get(key, cache_name=cache_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user