cache: Remove KEY_PREFIX from keys returned by cache_get_many.

Otherwise code paths that use those keys, like get_old_messages, will
incorrectly use the prefix-included keys.

This bug in our KEY_PREFIX system results in our memcached caching for
get_old_messages always missing.

(imported from commit 506c13e06d6f266596ead0b381c324c256e576c3)
This commit is contained in:
Tim Abbott
2013-06-19 13:31:55 -04:00
parent cc02890b1f
commit cb4e965fd2

View File

@@ -133,7 +133,7 @@ def cache_get_many(keys, cache_name=None):
cache_backend = get_cache(cache_name)
ret = cache_backend.get_many(keys)
memcached_stats_finish()
return ret
return dict([(key[len(KEY_PREFIX):], value) for key, value in ret.items()])
def cache_set_many(items, cache_name=None, timeout=None):
new_items = {}