@@ -182,7 +182,7 @@ def wrapper(*args, **kwargs):
182
182
infile_call_args = {self ._dict_key : call_args [self ._dict_key ]}
183
183
function_identifier = self .get_function_identifier (function , call_args )
184
184
stored_result , reduced_call_args = None , call_args
185
- if self .is_stored (function_identifier ):
185
+ if is_enabled ( function_identifier ) and self .is_stored (function_identifier ):
186
186
self ._logger .debug (f"Loading from storage: { function_identifier } " )
187
187
stored_result = self .load (function_identifier )
188
188
infile_missing_call_args = self .missing_call_args (infile_call_args , stored_result )
@@ -205,8 +205,9 @@ def wrapper(*args, **kwargs):
205
205
if stored_result is not None :
206
206
result = self .merge_results (stored_result , result )
207
207
# only save if new results
208
- self ._logger .debug ("Saving to storage: {}" .format (function_identifier ))
209
- self .save (result , function_identifier )
208
+ if is_enabled (function_identifier ):
209
+ self ._logger .debug ("Saving to storage: {}" .format (function_identifier ))
210
+ self .save (result , function_identifier )
210
211
assert self .callargs_present (result , infile_call_args )
211
212
result = self .filter_callargs (result , infile_call_args )
212
213
return result
@@ -288,8 +289,9 @@ def wrapper(*args, **kwargs):
288
289
if stored_result is not None :
289
290
result = self .merge_results (stored_result , result )
290
291
# only save if new results
291
- self ._logger .debug ("Saving to storage: {}" .format (function_identifier ))
292
- self .save (result , function_identifier )
292
+ if is_enabled (function_identifier ):
293
+ self ._logger .debug ("Saving to storage: {}" .format (function_identifier ))
294
+ self .save (result , function_identifier )
293
295
self .ensure_callargs_present (result , infile_call_args )
294
296
result = self .filter_callargs (result , infile_call_args )
295
297
return result
0 commit comments