mirror of
https://github.com/Hopiu/django-cachalot.git
synced 2026-05-16 00:23:10 +00:00
Uses set_many instead of multiple adds.
This commit is contained in:
parent
1f8167a53a
commit
603e018073
1 changed files with 1 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue