diff --git a/bookwyrm/utils/cache.py b/bookwyrm/utils/cache.py index 2fca1264..aebb8e75 100644 --- a/bookwyrm/utils/cache.py +++ b/bookwyrm/utils/cache.py @@ -6,5 +6,6 @@ def get_or_set(cache_key, function, *args, timeout=None): """Django's built-in get_or_set isn't cutting it""" value = cache.get(cache_key) if value is None: - cache.set(cache_key, function(*args), timeout=timeout) - return cache.get(cache_key) + value = function(*args) + cache.set(cache_key, value, timeout=timeout) + return value