@@ -36,12 +36,25 @@ def wrapper(*args, **kwargs):
36
36
)
37
37
value = sentinel
38
38
39
- if value is sentinel :
39
+ if value is None :
40
+ logger .warning (
41
+ 'None cache value found for cache key: {}, function cache key: {}, value: {}' .format (
42
+ cache_key , function_cache_key , value
43
+ )
44
+ )
45
+
46
+ # Need to check for None as well because the cache client sends a None response at times
47
+ if value is sentinel or value is None :
40
48
value = func (* args , ** kwargs )
41
49
# Try and set the key, value pair in the cache.
42
50
# But if it fails on an error from the underlying
43
51
# cache system, handle it.
44
52
try :
53
+ logger .info (
54
+ 'Setting cache key: {}, value: {} for function cache key: {}' .format (
55
+ cache_key , value , function_cache_key
56
+ )
57
+ )
45
58
cache .set (cache_key , value , timeout )
46
59
except CacheSetError :
47
60
logger .warning (
@@ -91,12 +104,25 @@ def wrapper(*args, **kwargs):
91
104
)
92
105
value = sentinel
93
106
94
- if value is sentinel :
107
+ if value is None :
108
+ logger .warning (
109
+ 'None cache value found for cache key: {}, function cache key: {}, value: {}' .format (
110
+ cache_key , function_cache_key , value
111
+ )
112
+ )
113
+
114
+ # Need to check for None as well because the cache client sends a None response at times
115
+ if value is sentinel or value is None :
95
116
value = func (* args , ** kwargs )
96
117
# Try and set the key, value pair in the cache.
97
118
# But if it fails on an error from the underlying
98
119
# cache system, handle it.
99
120
try :
121
+ logger .info (
122
+ 'Setting cache key: {}, value: {} for function cache key: {}' .format (
123
+ cache_key , value , function_cache_key
124
+ )
125
+ )
100
126
cache .set (cache_key , value , timeout )
101
127
except CacheSetError :
102
128
logger .warning (
@@ -167,12 +193,25 @@ def __call__(self, *args, **kwargs):
167
193
)
168
194
value = sentinel
169
195
170
- if value is sentinel :
196
+ if value is None :
197
+ logger .warning (
198
+ 'None cache value found for cache key: {}, function cache key: {}, value: {}' .format (
199
+ cache_key , function_cache_key , value
200
+ )
201
+ )
202
+
203
+ # Need to check for None as well because the cache client sends a None response at times
204
+ if value is sentinel or value is None :
171
205
value = self .func (* args , ** kwargs )
172
206
# Try and set the key, value pair in the cache.
173
207
# But if it fails on an error from the underlying
174
208
# cache system, handle it.
175
209
try :
210
+ logger .info (
211
+ 'Setting cache key: {}, value: {} for function cache key: {}' .format (
212
+ cache_key , value , function_cache_key
213
+ )
214
+ )
176
215
cache .set (cache_key , value , timeout )
177
216
except CacheSetError :
178
217
logger .warning (
0 commit comments