From 3edfb76c6a6b9cd7dd7a658115b5876b4e3187f7 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Mon, 15 Jan 2024 17:07:26 +0000 Subject: [PATCH] return response object too --- pv_site_api/cache.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pv_site_api/cache.py b/pv_site_api/cache.py index f9f7f6b..e121dbe 100644 --- a/pv_site_api/cache.py +++ b/pv_site_api/cache.py @@ -36,7 +36,7 @@ def remove_old_cache( last_updated.pop(key) response.pop(key) - return last_updated + return last_updated, response def cache_response(func): @@ -70,10 +70,9 @@ def wrapper(*args, **kwargs): # noqa if var in route_variables: route_variables.pop(var) - last_updated = remove_old_cache(last_updated, response) + last_updated, response = remove_old_cache(last_updated, response) # make into string - logger.debug(response.keys()) route_variables = json.dumps(route_variables) args_as_json = json.dumps(args) function_name = func.__name__