Uses set_many instead of multiple adds.

This commit is contained in:
Bertrand Bordage 2014-12-13 19:05:12 +01:00
parent 1f8167a53a
commit 603e018073

View file

@ -56,8 +56,7 @@ def _get_result_or_execute_query(execute_query_func, cache_key,
new_table_cache_keys = frozenset(table_cache_keys) - frozenset(data)
if new_table_cache_keys:
for table_cache_key in new_table_cache_keys:
cache.add(table_cache_key, time(), None)
cache.set_many(new_table_cache_keys, time(), None)
elif cache_key in data:
try:
timestamp, result = data.pop(cache_key)