From 47255e9cd85227fe97f178d928bf09648e7e368b Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 20 Jun 2013 10:41:23 -0400 Subject: [PATCH] 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) --- zephyr/lib/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/lib/cache.py b/zephyr/lib/cache.py index 85e0e1cfcf..fae721f6fb 100644 --- a/zephyr/lib/cache.py +++ b/zephyr/lib/cache.py @@ -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)