Skip to content

Commit

Permalink
return response object too
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Jan 15, 2024
1 parent 9c2b9df commit 3edfb76
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pv_site_api/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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__
Expand Down

0 comments on commit 3edfb76

Please sign in to comment.