Skip to content

Commit 5b85706

Browse files
author
anthonyp97
committed
update invlaidate for cached class method
1 parent 4381fb2 commit 5b85706

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cache_helper/decorators.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ def _cached(func):
7676
@wraps(func)
7777
def wrapper(*args, **kwargs):
7878
# skip the first arg because it will be the class itself
79-
function_cache_key = utils.get_function_cache_key(
80-
func_name, args[1:], kwargs
81-
)
79+
function_cache_key = utils.get_function_cache_key(func_name, args[1:], kwargs)
8280
cache_key = utils.get_hashed_cache_key(function_cache_key)
8381

8482
try:
@@ -115,7 +113,7 @@ def invalidate(*args, **kwargs):
115113
:param kwargs: The kwargs passed into the original function.
116114
:rtype: None
117115
"""
118-
function_cache_key = utils.get_function_cache_key(func_name, args, kwargs)
116+
function_cache_key = utils.get_function_cache_key(func_name, args[1:], kwargs)
119117
cache_key = utils.get_hashed_cache_key(function_cache_key)
120118
cache.delete(cache_key)
121119

0 commit comments

Comments
 (0)