Skip to content

Commit 17023da

Browse files
author
anthonyp97
committed
update comments
1 parent 5d5ebb5 commit 17023da

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cache_helper/decorators.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def wrapper(*args, **kwargs):
2424
function_cache_key = utils.get_function_cache_key(func_name, args, kwargs)
2525
cache_key = utils.get_hashed_cache_key(function_cache_key)
2626

27+
# We need to determine whether the object exists in the cache, and since we may have stored a literal value
28+
# None, use a sentinel object as the default
2729
sentinel = object()
2830
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.
3131
value = cache.get(cache_key, sentinel)
3232
except Exception:
3333
logger.warning(
@@ -79,10 +79,10 @@ def wrapper(*args, **kwargs):
7979
function_cache_key = utils.get_function_cache_key(func_name, args[1:], kwargs)
8080
cache_key = utils.get_hashed_cache_key(function_cache_key)
8181

82+
# We need to determine whether the object exists in the cache, and since we may have stored a literal value
83+
# None, use a sentinel object as the default
8284
sentinel = object()
8385
try:
84-
# Attempts to get cache key and defaults to a string constant which will be returned if the cache
85-
# key does not exist due to expiry or never being set.
8686
value = cache.get(cache_key, sentinel)
8787
except Exception:
8888
logger.warning(
@@ -155,10 +155,10 @@ def __get__(self, obj, objtype):
155155
def __call__(self, *args, **kwargs):
156156
cache_key, function_cache_key = self.create_cache_key(*args, **kwargs)
157157

158+
# We need to determine whether the object exists in the cache, and since we may have stored a literal value
159+
# None, use a sentinel object as the default
158160
sentinel = object()
159161
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.
162162
value = cache.get(cache_key, sentinel)
163163
except Exception:
164164
logger.warning(

0 commit comments

Comments
 (0)