Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
10kkyvl committed Dec 4, 2024
1 parent 2e3ee6b commit 2bdee44
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ def wrapper(*args, **kwargs) -> Callable:
key = (args, tuple(kwargs.items()))
if key in cached:
print("Getting from cache")
return cached[key]

print("Calculating new result")
result = func(*args, **kwargs)
cached[key] = result
result = cached[key]
else:
print("Calculating new result")
result = func(*args, **kwargs)
cached[key] = result
return result

return wrapper

0 comments on commit 2bdee44

Please sign in to comment.