Skip to content

Commit 4381fb2

Browse files
author
anthonyp97
committed
add comments
1 parent 6855aa0 commit 4381fb2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cache_helper/decorators.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def wrapper(*args, **kwargs):
2626
cache_key = utils.get_hashed_cache_key(function_cache_key)
2727

2828
try:
29+
# Attempts to get cache key and defaults to a string constant which will be returned if the cache
30+
# key does not exist due to expiry or never being set.
2931
value = cache.get(cache_key, CACHE_KEY_NOT_FOUND)
3032
except Exception:
3133
logger.warning(
@@ -80,6 +82,8 @@ def wrapper(*args, **kwargs):
8082
cache_key = utils.get_hashed_cache_key(function_cache_key)
8183

8284
try:
85+
# Attempts to get cache key and defaults to a string constant which will be returned if the cache
86+
# key does not exist due to expiry or never being set.
8387
value = cache.get(cache_key, CACHE_KEY_NOT_FOUND)
8488
except Exception:
8589
logger.warning(
@@ -151,7 +155,10 @@ def __get__(self, obj, objtype):
151155

152156
def __call__(self, *args, **kwargs):
153157
cache_key, function_cache_key = self.create_cache_key(*args, **kwargs)
158+
154159
try:
160+
# Attempts to get cache key and defaults to a string constant which will be returned if the cache
161+
# key does not exist due to expiry or never being set.
155162
value = cache.get(cache_key, CACHE_KEY_NOT_FOUND)
156163
except Exception:
157164
logger.warning(

0 commit comments

Comments
 (0)